function JsHttpRequest() { this._construct() }
(function() { // to create local-scope variables
    var COUNT       = 0;
    var PENDING     = {};
    var CACHE       = {};
    // Called by server script on data load. Static.
    JsHttpRequest.dataReady = function(id, text, js) {
        var undef;
        var th = PENDING[id];
        delete PENDING[id];
        if (th) {
            delete th._xmlReq;
            if (th.caching && th.hash) CACHE[th.hash] = [text, js];
            th._dataReady(text, js);
        } else if (th !== false) {
            throw "JsHttpRequest.dataReady(): unknown pending id: " + id;
        }
    }
    // Simple interface for most popular use-case.
    JsHttpRequest.query = function(url, content, onready, nocache) {
        var req = new JsHttpRequest();
        req.caching = !nocache;
        req.onreadystatechange = function() {
            if (req.readyState == 4) {
                onready(req.responseJS, req.responseText);
            }
        }
        req.open(null, url, true);
        req.send(content);
    },
    
    JsHttpRequest.prototype = {
        // Standard properties.
        onreadystatechange: null,
        readyState:         0,
        responseText:       null,
        responseXML:        null,
        status:             200,
        statusText:         "OK",
        // JavaScript response array/hash
        responseJS:         null,
        // Additional properties.
        session_name:       "PHPSESSID",  // set to SID cookie or GET parameter name
        caching:            false,        // need to use caching?
        loader:             null,         // loader to use ('form', 'script', 'xml'; null - autodetect)
        // Internals.
        _span:              null,
        _id:                null,
        _xmlReq:            null,
        _openArg:           null,
        _reqHeaders:        null,
        _maxUrlLen:         2000,
        dummy: function() {}, // empty constant function for ActiveX leak minimization
        abort: function() {
            if (this._xmlReq) {
                this._xmlReq.abort();
                this._xmlReq = null;
            }
            this._cleanupScript();
            this._changeReadyState(4, true); // 4 in IE & FF on abort() call; Opera does not change to 4.
        },
        open: function(method, url, asyncFlag, username, password) {
            // Append SID to original URL.
            var sid = this._getSid();
            if (sid) url += (url.indexOf('?')>=0? '&' : '?') + this.session_name + "=" + this.escape(sid);
            this._openArg = {
                method:     (method||'').toUpperCase(),
                url:        url,
                asyncFlag:  asyncFlag,
                username:   username != null? username : '',
                password:   password != null? password : ''
            };
            this._id = null;
            this._xmlReq = null;
            this._reqHeaders = [];
            this._changeReadyState(1, true); // compatibility with XMLHttpRequest
            return true;
        },
        
        send: function(content) {
            this._changeReadyState(1, true); // compatibility with XMLHttpRequest
            var id = (new Date().getTime()) + "" + COUNT++;
            var url = this._openArg.url; 
            // Prepare to build QUERY_STRING from query hash.
            var queryText = [];
            var queryElem = [];
            if (!this._hash2query(content, null, queryText, queryElem)) return;
            var loader = (this.loader||'').toLowerCase();
            var method = this._openArg.method;
            var xmlReq = null;
            if (queryElem.length && !loader) {
                // Always use form loader if we have at least one form element.
                loader = 'form';
            } else {
                // Try to obtain XML request object.
                xmlReq = this._obtainXmlReq(id, url)
            }
            // Full URL if parameters are passed via GET.
            var fullGetUrl = url + (url.indexOf('?')>=0? '&' : '?') + queryText.join('&');
            // Solve hashcode BEFORE appending ID and check if cache is already present.
            this.hash = null;
            if (this.caching && !queryElem.length) {
                this.hash = fullGetUrl;
                if (CACHE[this.hash]) {
                    var c = CACHE[this.hash];
                    this._dataReady(c[0], c[1]);
                    return false;
                }
            }
            // Detect loader and method. (Yes, lots of code and conditions!)
            var canSetHeaders = xmlReq && (window.ActiveXObject || xmlReq.setRequestHeader); 
            if (!loader) {
                // Auto-detect loader.
                if (xmlReq) {
                    // Can use XMLHttpRequest.
                    loader = 'xml';
                    switch (method) {
                        case "POST":
                            if (!canSetHeaders) {
                                // Use POST method. Pass query in request body.
                                // Opera 8.01 does not support setRequestHeader, so no POST method.
                                loader = 'form';
                            }
                            break;
                        case "GET":
                            // Length of the query is checked later.
                            break;
                        default:
                            // Method is not set: auto-detect method.
                            if (canSetHeaders) {
                                method = 'POST';
                            } else {
                                if (fullGetUrl.length > this._maxUrlLen) {
                                    method = 'POST';
                                    loader = 'form';
                                } else {
                                    method = 'GET';
                                }
                            }
                    }
                } else {
                    // Cannot use XMLHttpRequest.
                    loader = 'script';
                    switch (method) {
                        case "POST":
                            loader = 'form';
                            break;
                        case "GET":
                            // Length of the query is checked later.
                            break;
                        default:
                            if (fullGetUrl.length > this._maxUrlLen) {
                                method = 'POST';
                                loader = 'form';
                            } else {
                                method = 'GET';
                            }
                    }
                }
            } else if (!method) {
                // Loader is pre-defined, but method is not set.
                switch (loader) {
                    case 'form':
                        method = 'POST';
                        break;
                    case 'script':
                        method = 'GET';
                        break;
                    default:
                        if (canSetHeaders) {
                            method = 'POST';
                        } else {
                            method = 'GET';
                        }
                }
            }
            // Correct GET URL.
            var requestBody = null;
            if (method == 'GET') {
                url = fullGetUrl;
                if (url.length > this._maxUrlLen) return this._error('Cannot use so long query (URL is ' + url.length + ' byte(s) length) with GET request.');
            } else if (method == 'POST') {
                requestBody = queryText.join('&');
            } else {
                return this._error('Unknown method: ' + method + '. Only GET and POST are supported.');
            }
            // Append loading ID to URL: a=aaa&b=bbb&<id>
            url = url + (url.indexOf('?')>=0? '&' : '?') + 'JsHttpRequest=' + id + '-' + loader;
            // Save loading script.
            PENDING[id] = this;
            // Send the request.
            switch (loader) {
                case 'xml':
                    // Use XMLHttpRequest.
                    if (!xmlReq) return this._error('Cannot use XMLHttpRequest or ActiveX loader: not supported');
                    if (method == "POST" && !canSetHeaders) return this._error('Cannot use XMLHttpRequest loader or ActiveX loader, POST method: headers setting is not supported');
                    if (queryElem.length) return this._error('Cannot use XMLHttpRequest loader: direct form elements using and uploading are not implemented');
                    this._xmlReq = xmlReq;
                    var a = this._openArg;
                    this._xmlReq.open(method, url, a.asyncFlag, a.username, a.password);
                    if (canSetHeaders) {
                        // Pass pending headers.
                        for (var i=0; i<this._reqHeaders.length; i++)
                            this._xmlReq.setRequestHeader(this._reqHeaders[i][0], this._reqHeaders[i][1]);
                        // Set non-default Content-type. We cannot use 
                        // "application/x-www-form-urlencoded" here, because 
                        // in PHP variable HTTP_RAW_POST_DATA is accessible only when 
                        // enctype is not default (e.g., "application/octet-stream" 
                        // is a good start). We parse POST data manually in backend 
                        // library code.
                        this._xmlReq.setRequestHeader('Content-Type', 'application/octet-stream');
                    }
                    // Send the request.
                    return this._xmlReq.send(requestBody);
                case 'script':
                    // Create <script> element and run it.
                    if (method != 'GET') return this._error('Cannot use SCRIPT loader: it supports only GET method');
                    if (queryElem.length) return this._error('Cannot use SCRIPT loader: direct form elements using and uploading are not implemented');
                    this._obtainScript(id, url);
                    return true;
                case 'form':
                    // Create & submit FORM.
                    if (!this._obtainForm(id, url, method, queryText, queryElem)) return null;
                    return true;
                default:
                    return this._error('Unknown loader: ' + loader);
            }
        },
        getAllResponseHeaders: function() {
            if (this._xmlReq) return this._xmlReq.getAllResponseHeaders();
            return '';
        },
            
        getResponseHeader: function(label) {
            if (this._xmlReq) return this._xmlReq.getResponseHeader(label);
            return '';
        },
        setRequestHeader: function(label, value) {
            // Collect headers.
            this._reqHeaders[this._reqHeaders.length] = [label, value];
        },
        //
        // Internal functions.
        //
        // Constructor.
        _construct: function() {},
        // Do all work when data is ready.
        _dataReady: function(text, js) { with (this) {
            if (text !== null || js !== null) {
                status = 4;
                responseText = responseXML = text;
                responseJS = js;
            } else {
                status = 500;
                responseText = responseXML = responseJS = null;
            }
            _changeReadyState(2);
            _changeReadyState(3);
            _changeReadyState(4);
            _cleanupScript();
        }},
        // Called on error.
        _error: function(msg) {
            throw (window.Error? new Error(msg) : msg);
        },
        // Create new XMLHttpRequest object.
        _obtainXmlReq: function(id, url) {
            // If url.domain specified and differ from current, cannot use XMLHttpRequest!
            // XMLHttpRequest (and MS ActiveX'es) cannot work with different domains.
            var p = url.match(new RegExp('^([a-z]+)://([^/]+)(.*)', 'i'));
            if (p) {
                if (p[2].toLowerCase() == document.location.hostname.toLowerCase()) {
                    url = p[3];
                } else {
                    return null;
                }
            }
            
            // Try to use built-in loaders.
            var req = null;
            if (window.XMLHttpRequest) {
                try { req = new XMLHttpRequest() } catch(e) {}
            } else if (window.ActiveXObject) {
                try { req = new ActiveXObject("Microsoft.XMLHTTP") } catch(e) {}
                if (!req) try { req = new ActiveXObject("Msxml2.XMLHTTP") } catch (e) {}
            }
            if (req) {
                var th = this;
                req.onreadystatechange = function() { 
                    if (req.readyState == 4) {
                        // Avoid memory leak by removing closure.
                        req.onreadystatechange = th.dummy;
                        th.status = null;
                        try { 
                            // In case of abort() call, req.status is unavailable and generates exception.
                            // But req.readyState equals to 4 in this case. Stupid behaviour. :-(
                            th.status = req.status;
                            th.responseText = req.responseText;
                        } catch (e) {}
                        if (!th.status) return;
                        var funcRequestBody = null;
                        try {
                            // Prepare generator function & catch syntax errors on this stage.
                            eval('funcRequestBody = function() {\n' + th.responseText + '\n}');
                        } catch (e) {
                            return th._error("JavaScript code generated by backend is invalid!\n" + th.responseText)
                        }
                        // Call associated dataReady() outside try-catch block 
                        // to pass excaptions in onreadystatechange in usual manner.
                        funcRequestBody();
                    }
                };
                this._id = id;
            }
            return req;
        },
        // Create new script element and start loading.
        _obtainScript: function(id, href) { with (document) {
            // Oh shit! Damned stupid fucked Opera 7.23 does not allow to create SCRIPT 
            // element over createElement (in HEAD or BODY section or in nested SPAN - 
            // no matter): it is created deadly, and does not respons on href assignment.
            // So - always create SPAN.
            var span = createElement('SPAN');
            span.style.display = 'none';
            body.insertBefore(span, body.lastChild);
            span.innerHTML = 'Text for stupid IE.<s'+'cript></' + 'script>';
            setTimeout(function() {
                var s = span.getElementsByTagName('script')[0];
                s.language = 'JavaScript';
                if (s.setAttribute) s.setAttribute('src', href); else s.src = href;
            }, 10);
            this._id = id;
            this._span = span;
        }},
        // Create & submit form.
        _obtainForm: function(id, url, method, queryText, queryElem) {
            // In case of GET method - split real query string.
            if (method == 'GET') {
                queryText = url.split('?', 2)[1].split('&');
                url = url.split('?', 2)[0];
            }
            // Create invisible IFRAME with temporary form (form is used on empty queryElem).
            var div = document.createElement('DIV');
            div.id = 'jshr_d_' + id;
            div.style.position = 'absolute';
            div.style.visibility = 'hidden';
            div.innerHTML = 
                '<form enctype="multipart/form-data"></form>' + // stupid IE, MUST use innerHTML assignment :-(
                '<iframe src="javascript:\'\'" name="jshr_i_' + id + '" style="width:0px; height:0px; overflow:hidden; border:none"></iframe>';
            var form = div.getElementsByTagName('FORM')[0];
            var iframe = div.getElementsByTagName('IFRAME')[0];
            // Check if all form elements belong to same form.
            if (queryElem.length) {
                // If we have at least one form element, we use its form as POST container.
                form = queryElem[0][1].form;
                var foundFile = false;
                for (var i = 0; i < queryElem.length; i++) {
                    var e = queryElem[i][1];
                    if (!e.form) {
                        return this._error('Element "' + e.name + '" do not belongs to any form!');
                    }
                    if (e.form != form) {
                        return this._error('Element "' + e.name + '" belongs to different form. All elements must belong to the same form!');
                    }
                    foundFile = foundFile || (e.tagName.toLowerCase() == 'input' && (e.type||'').toLowerCase() == 'file');
                }
                var et = "multipart/form-data";
                if (form.enctype != et && foundFile) {
                    return this._error('Attribute "enctype" of elements\' form must be "' + et + '" (for IE), "' + form.enctype + '" given.');
                }
            }
            // Temporary disable ALL form elements in 'form' (including custom!).
            for (var i = 0; i < form.elements.length; i++) {
                var e = form.elements[i];
                if (e.name != null) {
                    e.jshrSaveName = e.name;
                    e.name = '';
                }
            }
            // Insert hidden fields to the form.
            var tmpE = [];
            for (var i=0; i<queryText.length; i++) {
                var pair = queryText[i].split('=', 2);
                var e = document.createElement('INPUT');
                e.type = 'hidden';
                e.name = unescape(pair[0]);
                e.value = pair[1] != null? unescape(pair[1]) : '';
                form.appendChild(e);
                tmpE[tmpE.length] = e;
            }
            // Enable custom form elements back & change their names.
            for (var i = 0; i < queryElem.length; i++) queryElem[i][1].name = queryElem[i][0];
            // Insert generated form inside the document.
            // Be careful: don't forget to close FORM container in document body!
            document.body.insertBefore(div, document.body.lastChild);
            this._span = div;
            // Temporary modify form attributes, submit form, restore attributes back.
            var sv = {};
            sv.enctype  = form.enctype;  form.enctype = "multipart/form-data";
            sv.action   = form.action;   form.action = url;
            sv.method   = form.method;   form.method = method;
            sv.target   = form.target;   form.target = iframe.name;
            sv.onsubmit = form.onsubmit; form.onsubmit = null;
            form.submit();
            for (var i in sv) form[i] = sv[i];
            
            // Remove generated temporary hidden elements from form.
            for (var i = 0; i < tmpE.length; i++) tmpE[i].parentNode.removeChild(tmpE[i]);
            // Enable all disabled elements back.
            for (var i = 0; i < form.elements.length; i++) {
                var e = form.elements[i];
                if (e.jshrSaveName != null) {
                    e.name = e.jshrSaveName;
                    e.jshrSaveName = null;
                }
            }
        },
        // Remove last used script element (clean memory).
        _cleanupScript: function() {
            var span = this._span;
            if (span) {
                this._span = null;
                setTimeout(function() {
                    // without setTimeout - crash in IE 5.0!
                    span.parentNode.removeChild(span);
                }, 50);
            }
            if (this._id) {
                // Mark this loading as aborted.
                PENDING[this._id] = false;
            }
            return false;
        },
        // Convert hash to QUERY_STRING.
        // If next value is scalar or hash, push it to queryText.
        // If next value is form element, push [name, element] to queryElem.
        _hash2query: function(content, prefix, queryText, queryElem) {
            if (prefix == null) prefix = "";
            if (content instanceof Object) {
                for (var k in content) {
                    var v = content[k];
                    if (v instanceof Function) continue;
                    var curPrefix = prefix? prefix+'['+this.escape(k)+']' : this.escape(k);
                    if (this._isFormElement(v)) {
                        var tn = v.tagName.toLowerCase();
                        if (tn == 'form') {
                            // This is FORM itself. Add all its elements.
                            for (var i=0; i<v.elements.length; i++) {
                                var e = v.elements[i];
                                if (e.name) queryElem[queryElem.length] = [e.name, e];
                            }
                        } else if (tn == 'input' || tn == 'textarea' || tn == 'select') {
                            // This is a single form elemenent.
                            queryElem[queryElem.length] = [curPrefix, v];
                        } else {
                            return this._error('Invalid FORM element detected: name=' + (e.name||'') + ', tag=' + e.tagName);
                        }
                    } else if (v instanceof Object) {
                        this._hash2query(v, curPrefix, queryText, queryElem);
                    } else {
                        // We MUST skip NULL values, because there is no method
                        // to pass NULL's via GET or POST request in PHP.
                        if (v === null) continue;
                        queryText[queryText.length] = curPrefix + "=" + this.escape('' + v);
                    }
                }
            } else {
                queryText = [content];
            }
            return true;
        },
        // Return true if e is any form element of FORM itself.
        _isFormElement: function(e) {
            // Fast & dirty method.
            return e && e.ownerDocument && e.parentNode && e.parentNode.appendChild && e.tagName;
        },
        // Return value of SID based on QUERY_STRING or cookie
        // (PHP compatible sessions).
        _getSid: function() {
            var m = document.location.search.match(new RegExp('[&?]'+this.session_name+'=([^&?]*)'));
            var sid = null;
            if (m) {
                sid = m[1];
            } else {
                var m = document.cookie.match(new RegExp('(;|^)\\s*'+this.session_name+'=([^;]*)'));
                if (m) sid = m[2];
            }
            return sid;
        },
        // Change current readyState and call trigger method.
        _changeReadyState: function(s, reset) { with (this) {
            if (reset) {
                status = statusText = responseJS = null;
                responseText = '';
            }
            readyState = s;
            if (onreadystatechange) onreadystatechange();
        }},
        // Stupid JS escape() does not quote '+'.
        escape: function(s) {
            return escape(s).replace(new RegExp('\\+','g'), '%2B');
        }
    }
})();
par = document;
upload_range = 1;
function L() {
document.getElementById('page_body').innerHTML = '<div id="page_body"><table width="100%" height="260" border="0"><tr><td align="center"><img src="img/loading.gif" alt="" width="32" height="32"></td></tr></table></div>';
}
function doLoadPage(query,arg1,arg2) {
L();
var req = new JsHttpRequest();
req.onreadystatechange = function() {
if (req.readyState == 4) {
if (req.responseJS) {
par.getElementById('page_body').innerHTML = req.responseJS.q||'';
if (arg2=='print') window.print();
if (query=='biz') init();
}
}
}
req.open(null, 'index.php?q1='+arg1, true);
req.send({ q: query, q1:arg1, q2:arg2 });
}
function getZ(n) {
var idn = '';
var p = '';
for (var i=0;i<n;i++) {
idn = 'cat_'+i;
if (document.getElementById(idn).checked) {
p = p + document.getElementById(idn).name+'-';
}
}
return p;
}
function getForm() {
var p = '';
p = p+document.getElementById('name').value+'|';
p = p+document.getElementById('org').value+'|';
p = p+document.getElementById('tel').value+'|';
p = p+document.getElementById('fax').value+'|';
p = p+document.getElementById('email').value+'|';
p = p+document.getElementById('url').value+'|';
p = p+document.getElementById('obl').value+'|';
p = p+document.getElementById('city').value+'|';
p = p+document.getElementById('zip').value+'|';
p = p+document.getElementById('adr').value+'|';
p = p+document.getElementById('diz').value+'|';
p = p+document.getElementById('termin').value+'|';
p = p+document.getElementById('aname').value+'|';
p = p+document.getElementById('atel').value+'|';
p = p+document.getElementById('id').value+'|';
return p;
}
function validateForm(n,m) {
var z=true;
if((document.getElementById('name').value=='')||(document.getElementById('tel').value=='')||(document.getElementById('email').value=='')||(document.getElementById('obl').value=='')||(document.getElementById('city').value=='')||(document.getElementById('zip').value=='')||(document.getElementById('adr').value=='')||(document.getElementById('diz').value=='')||(document.getElementById('termin').value=='')||(document.getElementById('aname').value=='')||(document.getElementById('atel').value=='')) {
alert('Заповніть будь-ласка усі поля...');
z=false;
}
if ((z)&&(m!='a')) doLoadPage('add','submit',getForm()+getZ(n));
if ((z)&&(m=='a')) doLoadPage('edit','submit',getForm()+getZ(n));
}
function ValidateEForm() {
if((document.getElementById('mailname').value=='')||(document.getElementById('email').value=='')||(document.getElementById('message').value=='')) {
alert('Заповніть будь-ласка всі поля...');
return false;
}
}
function info(id) {
var top=(screen.height-180)/2;var left=(screen.width-568)/1.1;
var win = "top="+top+",left="+left+",width=568,height=180,directories=no,menubar=no,status=no,location=no,resizable=no,scrollbars=yes";
W = window.open("info.php?id="+id,id,win);
}
eval(function(A,G){return A.replace(/(\w+)/g,function(a,b){return G[parseInt(b,36)]})}("0 1=2(3){0 4=2(){5 (0 6 7 8){9 (8[6]) 8[6].a=8;}\n9 (b[c] !=\n\'d\'\n&&8.e) f 8.e.g(8,b);};4.h=8.h;4.i=8.i;4.j=3;f 4;};1.k=2(){};1.l=2(3){f m 1(3);};1.j={h:2(3){0 n=m 8(\n\'d\'\n);5 (0 o 7 3){0 p=n[o];0 q=3[o];9 (p&&p !=q) q=p.r(q)||q;n[o]=q;}\nf m 1(n);},i:2(3){5 (0 o 7 3) 8.j[o]=3[o];}};s.h=2(){0 t=b;9 (t[u]) t=[t[c],t[u]];v t=[8,t[c]];5 (0 o 7 t[u]) t[c][o]=t[u][o];f t[c];};s.w=2(){5 (0 x=c;x<b.y;x++) b[x].h=1.j.i;};m s.w(z,10,11,12);z.h({r:2(q){0 p=8;f 2(){8.13=p;f q.g(8,b);};}});;z.h({14:2(t,15){0 16=8;9 ($17(t) !=\n\'18\'\n) t=[t];f 2(){f 16.g(15||16.a||16,t);};},15:2(15){0 16=8;f 2(){f 16.g(15,b);};},19:2(15){0 16=8;f 2(1a){16.1b(15,1a||1c.1a);f 1d;};},1e:2(1f,15){f 1g(8.15(15||8.a||8),1f);},1h:2(1f,15){f 1i(8.15(15||8.a||8),1f);}});2 $1j(1k){1l(1k);1m(1k);f 1n;};2 $17(1o){9 (!1o) f 1d;0 17=1d;9 (1o 1p z) 17=\n\'2\'\n;v 9 (1o.1q){9 (1o.1r==1s&&!\n/\\1t/.1u(1o.1v)) 17=\n\'1w\'\n;v 9 (1o.1r==u) 17=\n\'1x\'\n;}\nv 9 (1o 1p 10) 17=\n\'18\'\n;v 9 (1y 1o==\n\'1z\'\n) 17=\n\'1z\'\n;v 9 (1y 1o==\n\'20\'\n) 17=\n\'20\'\n;v 9 (1y 1o==\n\'21\'\n&&22(1o)) 17=\n\'21\'\n;f 17;};0 23=m 1({24:2(16){8.25=8.25||[];8.25.26(16);f 8;},27:2(){9 (8.25&&8.25.y) 8.25.28(c,u)[c].1e(29,8);},2a:2(){8.25=[];}});;9 (!10.j.2b){10.j.2b=2(16,15){5(0 x=c;x<8.y;x++) 16.1b(15,8[x],x);};}\n10.h({2c:10.j.2b,2d:2(){0 2e=[];5 (0 x=c;x<8.y;x++) 2e.26(8[x]);f 2e;},2f:2(2g){5 (0 x=c;x<8.y;x++){9 (8[x]==2g) 8.28(x,u);}\nf 8;},1u:2(2g){5 (0 x=c;x<8.y;x++){9 (8[x]==2g) f 2h;};f 1d;},h:2(2e){5 (0 x=c;x<2e.y;x++) 8.26(2e[x]);f 8;},2i:2(2j){0 2e=[];5 (0 x=c;x<8.y;x++) 2e[2j[x]]=8[x];f 2e;}});2 $2k(18){f 10.j.2d.1b(18);};;11.h({1u:2(2l,2m){f 8.2n(m 2o(2l,2m));},2p:2(){f 2q(8);},2r:2(){f 8.2s(\n/-\\2t/2u,2(2n){f 2n.2v(2n.y-u).2w();});},2x:2(){f 8.2y().2s(\n/\\2z[30-31]/32,2(2n){f 2n.2w();});},33:2(){f 8.2s(\n/^\\34*|\\34*$/32,\n\'\'\n);},35:2(){f 8.2s(\n/\\34\\34/32,\n\' \'\n).33();},36:2(18){0 37=8.1u(\n\'([\\\\38]{u,1s})\'\n,\n\'32\'\n);9 (37[1s]==c) f\n\'39\'\n;0 3a=[];5 (0 x=c;x<1s;x++){0 3b=(37[x]-c).3c(3d);3a.26(3b.y==u?\n\'c\'\n+3b:3b);}\n0 3e=\n\'#\'\n+3a.3f(\n\'\'\n);9 (18) f 3a;v f 3e;},3g:2(18){0 3a=8.1u(\n\'^[#]{c,u}([\\\\3h]{u,3i})([\\\\3h]{u,3i})([\\\\3h]{u,3i})$\'\n);0 37=[];5 (0 x=u;x<3a.y;x++){9 (3a[x].y==u) 3a[x]+=3a[x];37.26(2q(3a[x],3d));}\n0 3j=\n\'37(\'\n+37.3f(\n\',\'\n)+\n\')\'\n;9 (18) f 37;v f 3j;}});12.h({2p:2(){f 8;}});;0 3k=m 1({e:2(3l){9 ($17(3l)==\n\'20\'\n) 3l=3m.3n(3l);f $(3l);},3o:2(3l,3p){3l=$(3l)||m 3k(3l);3q(3p){3r\n\"3s\"\n:$(3l.3t).3u(8,3l);3v;3r\n\"3w\"\n:{9 (!3l.3x()) $(3l.3t).3y(8);v $(3l.3t).3u(8,3l.3x());} 3v;3r\n\"3z\"\n:3l.3y(8);3v;}\nf 8;},40:2(3l){f 8.3o(3l,\n\'3s\'\n);},41:2(3l){f 8.3o(3l,\n\'3w\'\n);},42:2(3l){f 8.3o(3l,\n\'3z\'\n);},43:2(3l){8.3y($(3l)||m 3k(3l));f 8;},2f:2(){8.3t.44(8);},45:2(46){f $(8.47(46||2h));},48:2(3l){0 3l=$(3l)||m 3k(3l);8.3t.49(3l,8);f 3l;},4a:2(4b){9 (8.4c()==\n\'4d\'\n&&1c.4e) 8.4f.4g=4b;v 8.3y(3m.4h(4b));f 8;},4i:2(4j){f !!8.4j.1u(\n\"\\\\2z\"\n+4j+\n\"\\\\2z\"\n);},4k:2(4j){9 (!8.4i(4j)) 8.4j=(8.4j+\n\' \'\n+4j.33()).35();f 8;},4l:2(4j){9 (8.4i(4j)) 8.4j=8.4j.2s(4j.33(),\n\'\'\n).35();f 8;},4m:2(4j){9 (8.4i(4j)) f 8.4l(4j);v f 8.4k(4j);},4n:2(o,4o){9 (o==\n\'4p\'\n) 8.4q(4r(4o));v 8.4d[o.2r()]=4o;f 8;},4s:2(4t){9 ($17(4t)==\n\'1z\'\n){5 (0 o 7 4t) 8.4n(o,4t[o]);} v 9 ($17(4t)==\n\'20\'\n){9 (1c.4e) 8.4g=4t;v 8.4u(\n\'4d\'\n,4t);}\nf 8;},4q:2(4p){9 (4p==c){9(8.4d.4v !=\n\"4w\"\n) 8.4d.4v=\n\"4w\"\n;} v {9(8.4d.4v !=\n\"4x\"\n) 8.4d.4v=\n\"4x\"\n;}\n9 (1c.4e) 8.4d.4y=\n\"4z(4p=\"\n+4p*50+\n\")\"\n;8.4d.4p=4p;f 8;},51:2(o){0 52=o.2r();0 4d=8.4d[52]||1d;9 (!4d){9 (3m.53) 4d=3m.53.54(8,1n).55(o);v 9 (8.56) 4d=8.56[52];}\n9 (4d&&[\n\'57\'\n,\n\'58\'\n,\n\'59\'\n].1u(52)&&4d.1u(\n\'37\'\n)) 4d=4d.36();f 4d;},5a:2(5b,16){8[5b+16]=16.15(8);9 (8.5c) 8.5c(5b,16,1d);v 8.5d(\n\'5e\'\n+5b,8[5b+16]);0 3l=8;9 (8 !=1c) 5f.5g.26(2(){3l.5h(5b,16);3l[5b+16]=1n;});f 8;},5h:2(5b,16){9 (8.5i) 8.5i(5b,16,1d);v 8.5j(\n\'5e\'\n+5b,8[5b+16]);f 8;},5k:2(5l){0 3l=8[5l+\n\'5m\'\n];5n ($17(3l)==\n\'1w\'\n) 3l=3l[5l+\n\'5m\'\n];f $(3l);},5o:2(){f 8.5k(\n\'p\'\n);},3x:2(){f 8.5k(\n\'5p\'\n);},5q:2(){0 3l=8.5r;5n ($17(3l)==\n\'1w\'\n) 3l=3l.5s;f $(3l);},5t:2(){0 3l=8.5u;5n ($17(3l)==\n\'1w\'\n)\n3l=3l.5v;f $(3l);},5w:2(o,4o){0 3l=1d;3q(o){3r\n\'5x\'\n:8.4j=4o;3v;3r\n\'4d\'\n:8.4s(4o);3v;3r\n\'5y\'\n:9 (1c.4e&&8.4c()==\n\'5z\'\n){3l=$(3m.3n(\n\'<5z 5y=\"\'\n+4o+\n\'\" />\'\n));$2k(8.60).2c(2(61){9 (61.5y !=\n\'5y\'\n) 3l.5w(61.5y,61.4o);});9 (8.3t) 8.48(3l);};62:8.4u(o,4o);}\nf 3l||8;},63:2(4t){5 (0 o 7 4t) 8.5w(o,4t[o]);f 8;},64:2(65){8.66=65;f 8;},67:2(o){f 8.68(o);},4c:2(){f 8.69.2y();},6a:2(5l){5l=5l.2x();0 3l=8;0 6b=c;6c {6b+=3l[\n\'6b\'\n+5l]||c;3l=3l.6d;} 5n (3l);f 6b;},6e:2(){f 8.6a(\n\'6f\'\n);},6g:2(){f 8.6a(\n\'6h\'\n);},6i:2(){0 4o=1d;3q(8.4c()){3r\n\'6j\'\n:4o=8.6k(\n\'6l\'\n)[8.6m].4o;3v;3r\n\'5z\'\n:9 ((8.6n&&[\n\'6o\'\n,\n\'6p\'\n].1u(8.17))||([\n\'4w\'\n,\n\'4b\'\n,\n\'6q\'\n].1u(8.17)))\n4o=8.4o;3v;3r\n\'6r\'\n:4o=8.4o;}\nf 4o;}});m s.w(3k);3k.h({6s:3k.j.4i,6t:3k.j.4k,6u:3k.j.4l,6v:3k.j.4m});2 $3k(3l,6w,t){9 ($17(t) !=\n\'18\'\n) t=[t];f 3k.j[6w].g(3l,t);};2 $(3l){9 ($17(3l)==\n\'20\'\n) 3l=3m.6x(3l);9 ($17(3l)==\n\'1x\'\n){9 (!3l.h){5f.6y.26(3l);3l.h=s.h;3l.h(3k.j);}\nf 3l;} v f 1d;};1c.5a=3m.5a=3k.j.5a;1c.5h=3m.5h=3k.j.5h;0 5f={6y:[],5g:[],6z:[],70:2(){5f.5g.2c(2(16){16();});1c.5h(\n\'70\'\n,1c.71);5f.6y.2c(2(3l){5(0 6 7 3k.j){1c[6]=1n;3m[6]=1n;3l[6]=1n;}\n3l.h=1n;});}};1c.71=5f.70;1c.5a(\n\'70\'\n,1c.71);;0 72=73={};72.74=m 1({75:2(76){8.76=s.h({77:1.k,78:1.k,79:72.7a.7b,7c:7d,7e:\n\'7f\'\n,7g:2h,7h:7i},76||{});},7j:2(){0 7k=m 7l().7m();9 (7k<8.7k+8.76.7c){8.7n=7k-8.7k;8.7o();} v {8.76.78.14(8.1x,8).1e(29);8.7p();8.27();8.7q=8.7r;}\n8.7s();},7t:2(7r){8.7q=7r;8.7s();f 8;},7o:2(){8.7q=8.7u(8.7v,8.7r);},7u:2(7v,7r){f 8.76.79(8.7n,7v,(7r-7v),8.76.7c);},7w:2(7v,7r){9 (!8.76.7g) 8.7p();9 (8.1k) f;8.76.77.14(8.1x,8).1e(29);8.7v=7v;8.7r=7r;8.7k=m 7l().7m();8.1k=8.7j.1h(7x.7y(7z/8.76.7h),8);f 8;},7p:2(){8.1k=$1j(8.1k);f 8;},4n:2(1x,o,4o){1x.4n(o,4o+8.76.7e);}});72.74.i(m 23);72.80=72.74.h({e:2(3l,o,76){8.1x=$(3l);8.75(76);8.o=o.2r();},81:2(){f 8.7t(c);},82:2(83){f 8.7w(8.7q||c,83);},7s:2(){8.4n(8.1x,8.o,8.7q);}});72.84=72.74.h({e:2(3l,76){8.1x=$(3l);8.75(76);8.7q={};},7o:2(){5 (0 6 7 8.7v) 8.7q[6]=8.7u(8.7v[6],8.7r[6]);},7w:2(85){9 (8.1k&&8.76.7g) f;0 7v={};0 7r={};5 (0 6 7 85){7v[6]=85[6][c];7r[6]=85[6][u];}\nf 8.13(7v,7r);},7s:2(){5 (0 6 7 8.7q) 8.4n(8.1x,6,8.7q[6]);}});3k.h({86:2(o,76){f m 72.80(8,o,76);},87:2(76){f m 72.84(8,76);}});72.7a={88:2(89,2z,8a,38){f 8a*89/38+2z;},7b:2(89,2z,8a,38){f-8a\n/3i * (7x.8b(7x.8c*89/38)-u)+2z;}};;0 8d=8e=m 1({75:2(76){8.76={6w:\n\'8f\'\n,8g:1n,8h:2h,78:1.k,8i:1.k,8j:1n,8k:1d};s.h(8.76,76||{});},e:2(8l,76){8.75(76);8.8l=8l;8.8m=8.8n();},8o:2(){8.8m.8p(8.76.6w,8.8l,8.76.8h);8.8m.8q=8.8i.15(8);9 (8.76.6w==\n\'8f\'\n){8.8m.8r(\n\'8s-17\'\n,\n\'8t/8u-8v-8w-8x\'\n);9 (8.8m.8y) 8.8m.8r(\n\'8z\'\n,\n\'90\'\n);}\n3q($17(8.76.8g)){3r\n\'1x\'\n:8.76.8g=$(8.76.8g).91();3v;3r\n\'1z\'\n:8.76.8g=s.91(8.76.8g);}\n9($17(8.76.8g)==\n\'20\'\n) 8.8m.92(8.76.8g);v 8.8m.92(1n);f 8;},8i:2(){8.76.8i.1e(29,8);9 (8.8m.93==94&&8.8m.95==96){9 (8.76.8j) $(8.76.8j).64(8.8m.97);8.76.78.14([8.8m.97,8.8m.98],8).1e(99);9 (8.76.8k) 8.8k.1e(9a,8);8.8m.8q=1.k;8.27();}},8k:2(){9(9b=8.8m.97.2n(\n/<9c[^>]*?>[\\1t\\34]*?<\\/9c>/32)){9b.2c(2(9c){9d(9c.2s(\n/^<9c[^>]*?>/,\n\'\'\n).2s(\n/<\\/9c>$/,\n\'\'\n));});}},8n:2(){9 (1c.9e) f m 9e();v 9 (1c.4e) f m 4e(\n\'9f.9g\'\n);}});8d.i(m 23);s.91=2(4t){0 9h=[];5 (0 o 7 4t) 9h.26(9i(o)+\n\'=\'\n+9i(4t[o]));f 9h.3f(\n\'&\'\n);};3k.h({92:2(76){76=s.h(76,{8g:8.91(),6w:\n\'8f\'\n});f m 8d(8.67(\n\'5b\'\n),76).8o();},91:2(){0 9h=[];$2k(8.6k(\n\'*\'\n)).2c(2(3l){0 5y=$(3l).5y;0 4o=3l.6i();9 (4o&&5y) 9h.26(9i(5y)+\n\'=\'\n+9i(4o));});f 9h.3f(\n\'&\'\n);}});;0 9j={9k:2(){9 (1c.4e) 3m.9l(\n\"9m\"\n,1d,2h);},h:s.h,9n:2(){f 1c.9o||3m.9p.9q||c;},9r:2(){f 1c.9s||3m.9p.9t||c;},9u:2(){f 3m.9p.9v;},9w:2(){f 3m.9p.9x;},9y:2(){f 3m.9p.9z||1c.a0||c;},a1:2(){f 3m.9p.a2||1c.a3||c;},a4:2(a5){0 a6=3m.93;9 (a6&&3m.a7&&!3m.a8&&!a9.aa){9 (a6.1u(\n/ab|ac/)) f a5();v f 9j.a4.14(a5).1e(50);} v 9 (a6&&1c.4e){0 9c=$(\n\'ad\'\n);9 (!9c) 3m.ae(\n\"<9c af=\'ad\' ag=\'2h\' ah=\'://\'></9c>\"\n);$(\n\'ad\'\n).5a(\n\'ai\'\n,2(){9 (8.93==\n\'ac\'\n) a5();});f;} v {0 aj=2(){9 (b.ak.al) f;b.ak.al=2h;a5();};1c.5a(\n\"am\"\n,aj);3m.5a(\n\"an\"\n,aj);}}};;0 ao={3c:2(3l){0 20=[];0 ap=2(18){0 20=[];18.2c(2(aq){20.26(ao.3c(aq));});f 20.3f(\n\',\'\n);};0 ar=2(1z){0 20=[];5 (0 o 7 1z) 20.26(\n\'\"\'\n+o+\n\'\":\'\n+ao.3c(1z[o]));f 20.3f(\n\',\'\n);};3q($17(1o)){3r\n\'21\'\n:20.26(1o);3v;3r\n\'20\'\n:20.26(\n\'\"\'\n+1o+\n\'\"\'\n);3v;3r\n\'2\'\n:20.26(1o);3v;3r\n\'1z\'\n:20.26(\n\'{\'\n+ar(1o)+\n\'}\'\n);3v;3r\n\'18\'\n:20.26(\n\'[\'\n+ap(1o)+\n\']\'\n);}\nf 20.3f(\n\',\'\n);},as:2(at){f 9d(\n\'(\'\n+at+\n\')\'\n);}};;72.au=72.74.h({e:2(3l,76){8.1x=$(3l);8.75(76);},av:2(){f 8.7w(8.1x.9z,8.1x.9v-8.1x.aw);},ax:2(){f 8.7w(8.1x.9z,c);},7s:2(){8.1x.9z=8.7q;}});72.ay=72.74.h({e:2(3l,76){8.1x=$(3l);8.az=m 3k(\n\'b0\'\n).41(8.1x).4n(\n\'b1\'\n,\n\'4w\'\n).43(8.1x);8.75(76);9 (!8.76.b2) 8.76.b2=\n\'b3\'\n;8.7q=[];},7o:2(){[c,u].2c(2(x){8.7q[x]=8.7u(8.7v[x],8.7r[x]);},8);},b3:2(){8.b4=\n\'6f\'\n;8.b5=\n\'b6\'\n;8.b7=[8.1x.9v,\n\'c\'\n];8.b8=[\n\'c\'\n,-8.1x.9v];f 8;},b9:2(){8.b4=\n\'6h\'\n;8.b5=\n\'ba\'\n;8.b7=[8.1x.9x,\n\'c\'\n];8.b8=[\n\'c\'\n,-8.1x.9x];f 8;},81:2(){8[8.76.b2]();8.az.4n(8.b5,\n\'c\'\n);8.1x.4n(\n\'b4-\'\n+8.b4,-8.1x[\n\'bb\'\n+8.b5.2x()]+8.76.7e);f 8;},bc:2(){8[8.76.b2]();8.az.4n(8.b5,8.1x[\n\'bb\'\n+8.b5.2x()]+8.76.7e);8.1x.4n(\n\'b4-\'\n+8.b4,\n\'c\'\n);f 8;},bd:2(b2){8[8.76.b2]();9 (8.az[\n\'6b\'\n+8.b5.2x()]>c) f 8.7w(8.b7,8.b8);v f 8.7w(8.b8,8.b7);},7s:2(){8.az.4n(8.b5,8.7q[c]+8.76.7e);8.1x.4n(\n\'b4-\'\n+8.b4,8.7q[u]+8.76.7e);}});72.be=72.74.h({e:2(3l,o,76){8.1x=$(3l);8.75(76);8.o=o;8.7q=[];},7w:2(7v,7r){f 8.13(7v.3g(2h),7r.3g(2h));},7o:2(){[c,u,3i].2c(2(x){8.7q[x]=7x.7y(8.7u(8.7v[x],8.7r[x]));},8);},7s:2(){8.1x.4n(8.o,\n\"37(\"\n+8.7q[c]+\n\",\"\n+8.7q[u]+\n\",\"\n+8.7q[3i]+\n\")\"\n);},bf:2(57){f 8.7w(57,8.1x.51(8.o));},bg:2(57){f 8.7w(8.1x.51(8.o),57);}});;72.bh=72.80.h({e:2(3l,76){8.13(3l,\n\'b6\'\n,76);8.1x.4n(\n\'b1\'\n,\n\'4w\'\n);},bd:2(){9 (8.1x.aw>c) f 8.7w(8.1x.aw,c);v f 8.7w(c,8.1x.9v);},bc:2(){f 8.7t(8.1x.9v);}});72.bi=72.80.h({e:2(3l,76){8.13(3l,\n\'ba\'\n,76);8.1x.4n(\n\'b1\'\n,\n\'4w\'\n);8.bj=8.1x.bk;},bd:2(){9 (8.1x.bk>c) f 8.7w(8.1x.bk,c);v f 8.7w(c,8.bj);},bc:2(){f 8.7t(8.bj);}});72.bl=72.80.h({e:2(3l,76){8.13(3l,\n\'4p\'\n,76);8.7q=u;},bd:2(){9 (8.7q>c) f 8.7w(u,c);v f 8.7w(c,u);},bc:2(){f 8.7t(u);}});","var,Class,function,properties,klass,for,p,in,this,if,_proto_,arguments,0,noinit,initialize,return,apply,extend,implement,prototype,empty,create,new,pr0t0typ3,property,previous,current,parentize,Object,args,1,else,Native,i,length,Function,Array,String,Number,parent,pass,bind,fn,type,array,bindAsEventListener,event,call,window,false,delay,ms,setTimeout,periodical,setInterval,clear,timer,clearTimeout,clearInterval,null,obj,instanceof,nodeName,nodeType,3,S,test,nodeValue,textnode,element,typeof,object,string,number,isFinite,Chain,chain,chains,push,callChain,splice,10,clearChain,forEach,each,copy,newArray,remove,item,true,associate,keys,A,regex,params,match,RegExp,toInt,parseInt,camelCase,replace,D,gi,charAt,toUpperCase,capitalize,toLowerCase,b,a,z,g,trim,s,clean,rgbToHex,rgb,d,transparent,hex,bit,toString,16,hexText,join,hexToRgb,w,2,rgbText,Element,el,document,createElement,inject,where,switch,case,before,parentNode,insertBefore,break,after,getNext,appendChild,inside,injectBefore,injectAfter,injectInside,adopt,removeChild,clone,contents,cloneNode,replaceWith,replaceChild,appendText,text,getTag,style,ActiveXObject,styleSheet,cssText,createTextNode,hasClass,className,addClass,removeClass,toggleClass,setStyle,value,opacity,setOpacity,parseFloat,setStyles,source,setAttribute,visibility,hidden,visible,filter,alpha,100,getStyle,proPerty,defaultView,getComputedStyle,getPropertyValue,currentStyle,color,backgroundColor,borderColor,addEvent,action,addEventListener,attachEvent,on,Unload,functions,removeEvent,removeEventListener,detachEvent,getBrother,what,Sibling,while,getPrevious,next,getFirst,firstChild,nextSibling,getLast,lastChild,previousSibling,setProperty,class,name,input,attributes,attribute,default,setProperties,setHTML,html,innerHTML,getProperty,getAttribute,tagName,getOffset,offset,do,offsetParent,getTop,top,getLeft,left,getValue,select,getElementsByTagName,option,selectedIndex,checked,checkbox,radio,password,textarea,hasClassName,addClassName,removeClassName,toggleClassName,method,getElementById,elements,vars,unload,removeFunction,Fx,fx,Base,setOptions,options,onStart,onComplete,transition,Transitions,sineInOut,duration,500,unit,px,wait,fps,50,step,time,Date,getTime,cTime,setNow,clearTimer,now,to,increase,set,compute,from,custom,Math,round,1000,Style,hide,goTo,val,Styles,objFromTo,effect,effects,linear,t,c,cos,PI,Ajax,ajax,post,postBody,async,onStateChange,update,evalScripts,url,transport,getTransport,request,open,onreadystatechange,setRequestHeader,Content,application,x,www,form,urlencoded,overrideMimeType,Connection,close,toQueryString,send,readyState,4,status,200,responseText,responseXML,20,30,scripts,script,eval,XMLHttpRequest,Microsoft,XMLHTTP,queryString,encodeURIComponent,Window,disableImageCache,execCommand,BackgroundImageCache,getWidth,innerWidth,documentElement,clientWidth,getHeight,innerHeight,clientHeight,getScrollHeight,scrollHeight,getScrollWidth,scrollWidth,getScrollTop,scrollTop,pageYOffset,getScrollLeft,scrollLeft,pageXOffset,onDomReady,init,state,childNodes,all,navigator,taintEnabled,loaded,complete,_ie_ready_,write,id,defer,src,readystatechange,myInit,callee,done,load,DOMContentLoaded,Json,isArray,ar,isObject,evaluate,str,Scroll,down,offsetHeight,up,Slide,wrapper,div,overflow,mode,vertical,margin,layout,height,startPosition,endPosition,horizontal,width,scroll,show,toggle,Color,fromColor,toColor,Height,Width,iniWidth,offsetWidth,Opacity".split(",")));
var timedSlideShow = Class.create();
timedSlideShow.prototype = {
initialize: function(element, data, duration, speed) {
this.currentIter = 0;
this.lastIter = 0;
this.maxIter = 0;
this.slideShowElement = element;
this.slideShowData = data;
this.slideShowInit = 1;
this.slideElements = Array();
this.slideShowDelay = duration;
this.slideFadeSpeed = speed;
this.articleLink = "";
this.slideInfoZone = "";
element.style.display="block";
this.articleLink = document.createElement('a');
this.articleLink.className = 'global';
element.appendChild(this.articleLink);
this.articleLink.href = "";
this.maxIter = data.length;
for(i=0;i<data.length;i++)
{
var currentImg = document.createElement('div');
currentImg.className = "slideElement";
currentImg.style.position="absolute";
currentImg.style.left="0px";
currentImg.style.top="0px";
currentImg.style.margin="0px";
currentImg.style.border="0px";
currentImg.style.backgroundImage="url('" + data[i][0] + "')";
currentImg.style.backgroundPosition="center center";
this.articleLink.appendChild(currentImg);
currentImg.currentOpacity = new fx.Opacity(currentImg, {duration: this.slideFadeSpeed});
currentImg.setStyle('opacity',0);
this.slideElements[parseInt(i)] = currentImg;
}

this.loadingElement = document.createElement('div');
this.loadingElement.className = 'loadingElement';
this.articleLink.appendChild(this.loadingElement);

this.slideInfoZone = document.createElement('div');
this.slideInfoZone.className = 'slideInfoZone';
this.articleLink.appendChild(this.slideInfoZone);
this.slideInfoZone.style.opacity = 0;
this.doSlideShow();
},
destroySlideShow: function(element) {
var myClassName = element.className;
var newElement = document.createElement('div');
newElement.className = myClassName;
element.parentNode.replaceChild(newElement, element);
},
startSlideShow: function() {
this.loadingElement.style.display = "none";
this.lastIter = this.maxIter - 1;
this.currentIter = 0;
this.slideShowInit = 0;
this.slideElements[parseInt(this.currentIter)].setStyle('opacity', 1);
setTimeout(this.showInfoSlideShow.bind(this),1000);
setTimeout(this.hideInfoSlideShow.bind(this),this.slideShowDelay-1000);
setTimeout(this.nextSlideShow.bind(this),this.slideShowDelay);
},
nextSlideShow: function() {
this.lastIter = this.currentIter;
this.currentIter++;
if (this.currentIter >= this.maxIter)
{
this.currentIter = 0;
this.lastIter = this.maxIter - 1;
}
this.slideShowInit = 0;
this.doSlideShow.bind(this)();
},
doSlideShow: function() {
if (this.slideShowInit == 1)
{
imgPreloader = new Image();
// once image is preloaded, start slideshow
imgPreloader.onload=function(){
setTimeout(this.startSlideShow.bind(this),10);
}.bind(this);
imgPreloader.src = this.slideShowData[0][0];
} else {
if (this.currentIter != 0) {
this.slideElements[parseInt(this.currentIter)].currentOpacity.options.onComplete = function() {
this.slideElements[parseInt(this.lastIter)].setStyle('opacity',0);
}.bind(this);
this.slideElements[parseInt(this.currentIter)].currentOpacity.custom(0, 1);
} else {
this.slideElements[parseInt(this.currentIter)].setStyle('opacity',1);
this.slideElements[parseInt(this.lastIter)].currentOpacity.custom(1, 0);
}
setTimeout(this.showInfoSlideShow.bind(this),1000);
setTimeout(this.hideInfoSlideShow.bind(this),this.slideShowDelay-1000);
setTimeout(this.nextSlideShow.bind(this),this.slideShowDelay);
}
},
showInfoSlideShow: function() {
this.articleLink.removeChild(this.slideInfoZone);
this.slideInfoZone = document.createElement('div');
this.slideInfoZone.styles = new fx.Styles(this.slideInfoZone);
this.slideInfoZone.setStyle('opacity',0);
var slideInfoZoneTitle = document.createElement('h2');
slideInfoZoneTitle.innerHTML = this.slideShowData[this.currentIter][2]
this.slideInfoZone.appendChild(slideInfoZoneTitle);
var slideInfoZoneDescription = document.createElement('p');
slideInfoZoneDescription.innerHTML = this.slideShowData[this.currentIter][3];
this.slideInfoZone.appendChild(slideInfoZoneDescription);
this.articleLink.appendChild(this.slideInfoZone);
this.articleLink.href = this.slideShowData[this.currentIter][1];
this.slideInfoZone.className = 'slideInfoZone';
this.slideInfoZone.normalHeight = this.slideInfoZone.getStyle('height', true).toInt();
if (this.slideShowData[this.currentIter][2]!='' && this.slideShowData[this.currentIter][3]!='')
this.slideInfoZone.styles.custom({'opacity': [0, 0.7], 'height': [0, this.slideInfoZone.normalHeight]});
},
hideInfoSlideShow: function() {
if (this.slideShowData[this.currentIter][2]!='' && this.slideShowData[this.currentIter][3]!='')
this.slideInfoZone.styles.custom({'opacity': [0.7, 0]});
}
};
function initTimedSlideShow(element, data) {
var slideshow = new timedSlideShow(element, data);
}
function addLoadEvent(func) {
var oldonload = window.onload;
if (typeof window.onload != 'function') {
window.onload = func;
} else {
window.onload = function() {
oldonload();
func();
}
}
}
function Node(id, pid, name, url, title, count) {
this.id = id;
this.pid = pid;
this.name = name;
this.url = url;
this.title = title;
this.count = count;
this._io = false;
this._is = false;
this._ls = false;
this._hc = false;
this._ai = 0;
this._p;
};
function dTree(objName,url) {
this.config = {
closeSameLevel: false
}
this.icon = {
empty: "img/dtree/empty.gif",
line: "img/dtree/line.gif",
join: "img/dtree/join.gif",
joinBottom: "img/dtree/joinbottom.gif",
plus: "img/dtree/plus.gif",
plusBottom: "img/dtree/plusbottom.gif",
minus: "img/dtree/minus.gif",
minusBottom: "img/dtree/minusbottom.gif",
nlPlus: "img/dtree/nolines_plus.gif",
nlMinus: "img/dtree/nolines_minus.gif"
};
this.obj = objName;
this.aNodes = [];
this.aIndent = [];
this.root = new Node(-1);
this.selectedNode = null;
this.selectedFound = false;
this.completed = false;
};
dTree.prototype.add = function(id, pid, name, url, title, count) {
this.aNodes[this.aNodes.length] = new Node(id, pid, name, url, title, count);
};
dTree.prototype.openAll = function() {
this.oAll(true);
};
dTree.prototype.closeAll = function() {
this.oAll(false);
};
dTree.prototype.toString = function() {
var str = '<div class="dtree">\n';
if (document.getElementById) {
str += this.addNode(this.root);
} else str += 'Browser not supported.';
str += '</div>';
if (!this.selectedFound) this.selectedNode = null;
this.completed = true;
return str;
};
dTree.prototype.addNode = function(pNode) {
var str = '';
var n=0;
for (n; n<this.aNodes.length; n++) {
if (this.aNodes[n].pid == pNode.id) {
var cn = this.aNodes[n];
cn._p = pNode;
cn._ai = n;
this.setCS(cn);
if (cn._hc) cn.url = null;
str += this.node(cn, n);
if (cn._ls) break;
}
}
return str;
};
dTree.prototype.node = function(node, nodeId) {
var str = '<div class="dTreeNode">' + this.indent(node, nodeId);
if (node.url) {
str += '<a id="s' + this.obj + nodeId + '" class="' + 'node' + '" onclick=doLoadPage("biz",' + node.url +  ')';
if (node.title) str += ' title="' + node.title + '"';
str += '>';
}
else if (!node.url && node._hc && node.pid != this.root.id)
str += '<a onclick="' + this.obj + '.o(' + nodeId + ');" class="node">';
str += node.name;
if (node.url || (!node.url && node._hc)) str += '</a>';
str += '</div>';
if (node._hc) {
str += '<div id="d' + this.obj + nodeId + '" class="clip" style="display:' + ((this.root.id == node.pid || node._io) ? 'block' : 'none') + ';">';
str += this.addNode(node);
str += '</div>';
}
this.aIndent.pop();
return str;
};
dTree.prototype.indent = function(node, nodeId) {
var str = '';
if (this.root.id != node.pid) {
for (var n=0; n<this.aIndent.length; n++)
str += '<img src="' + ( (this.aIndent[n] == 1) ? this.icon.line : this.icon.empty ) + '" alt="" />';
(node._ls) ? this.aIndent.push(0) : this.aIndent.push(1);
if (node._hc) {
str += '<a onclick="' + this.obj + '.o(' + nodeId + ');"><img id="j' + this.obj + nodeId + '" src="';
str += ( (node._io) ? ((node._ls) ? this.icon.minusBottom : this.icon.minus) : ((node._ls) ? this.icon.plusBottom : this.icon.plus ) );
str += '" alt="" /></a>';
} else str += '<img src="' + ((node._ls) ? this.icon.joinBottom : this.icon.join ) + '" alt="" />';
}
return str;
};
dTree.prototype.setCS = function(node) {
var lastId;
for (var n=0; n<this.aNodes.length; n++) {
if (this.aNodes[n].pid == node.id) node._hc = true;
if (this.aNodes[n].pid == node.pid) lastId = this.aNodes[n].id;
}
if (lastId==node.id) node._ls = true;
};
dTree.prototype.o = function(id) {
var cn = this.aNodes[id];
this.nodeStatus(!cn._io, id, cn._ls);
cn._io = !cn._io;
if (this.config.closeSameLevel) this.closeLevel(cn);
};
dTree.prototype.oAll = function(status) {
for (var n=0; n<this.aNodes.length; n++) {
if (this.aNodes[n]._hc && this.aNodes[n].pid != this.root.id) {
this.nodeStatus(status, n, this.aNodes[n]._ls)
this.aNodes[n]._io = status;
}
}
};
dTree.prototype.closeLevel = function(node) {
for (var n=0; n<this.aNodes.length; n++) {
if (this.aNodes[n].pid == node.pid && this.aNodes[n].id != node.id && this.aNodes[n]._hc) {
this.nodeStatus(false, n, this.aNodes[n]._ls);
this.aNodes[n]._io = false;
}
}
}
dTree.prototype.nodeStatus = function(status, id, bottom) {
eDiv= document.getElementById('d' + this.obj + id);
eJoin= document.getElementById('j' + this.obj + id);
eJoin.src = ((status)?((bottom)?this.icon.minusBottom:this.icon.minus):((bottom)?this.icon.plusBottom:this.icon.plus));
eDiv.style.display = (status) ? 'block': 'none';
};
if (!Array.prototype.push) {
Array.prototype.push = function array_push() {
for(var i=0;i<arguments.length;i++)
this[this.length]=arguments[i];
return this.length;
}
};
if (!Array.prototype.pop) {
Array.prototype.pop = function array_pop() {
lastElement = this[this.length-1];
this.length = Math.max(this.length-1,0);
return lastElement;
}
};
dTree.prototype.openTo = function(nId) {
for (var n=0; n<this.aNodes.length; n++) {
if (this.aNodes[n].id == nId) {
nId=n;
break;
}
}
var cn=this.aNodes[nId];
if (cn.pid==this.root.id || !cn._p) return;
cn._io = true;
if (this.completed && cn._hc) this.nodeStatus(true, cn._ai, cn._ls);
this.openTo(cn._p._ai);
};
var img_dir = "/img/";
function _sort(a, b) {
    var a = a[0];
    var b = b[0];
    if (Number(a) && Number(b)) return sort_numbers(a, b);
    else  return sort_insensitive(a, b);
}
function sort_numbers(a, b) {
    return a - b;
}
function sort_insensitive(a, b) {
    var anew = a.toLowerCase();
    var bnew = b.toLowerCase();
    if (anew < bnew) return -1;
    if (anew > bnew) return 1;
    return 0;
}
function getConcatenedTextContent(node) {
    var _result = "";
    if (node == null) {
        return _result;
    }
    var childrens = node.childNodes;
    var i = 0;
    while (i < childrens.length) {
        var child = childrens.item(i);
        switch (child.nodeType) {
            case 1:
            case 5:
                _result += getConcatenedTextContent(child);
                break;
            case 3:
            case 2:
            case 4:
                _result += child.nodeValue;
                break;
            case 6:
            case 7:
            case 8:
            case 9:
            case 10:
            case 11:
            case 12:
            break;
        }
        i++;
    }
    return _result;
}
function sort(e) {
    var el = window.event ? window.event.srcElement : e.currentTarget;
    while (el.tagName.toLowerCase() != "td") el = el.parentNode;
    var a = new Array();
    var name = el.lastChild.nodeValue;
    var dad = el.parentNode;
    var table = dad.parentNode.parentNode;
    var up = table.up;
    var node, arrow, curcol;
    for (var i = 0; (node = dad.getElementsByTagName("td").item(i)); i++) {
        if (node.lastChild.nodeValue == name){
            curcol = i;
            if (node.className == "curcol"){
                arrow = node.firstChild;
                table.up = Number(!up);
                arrow.src = img_dir + table.up + ".gif";
                arrow.alt = "";
            }else{
                node.className = "curcol";
                arrow = node.insertBefore(document.createElement("img"),node.firstChild);
                table.up = 0;
                arrow.src = img_dir + Number(table.up) + ".gif";
                arrow.alt = "";
            }
        }else{
            if (node.className == "curcol"){
                node.className = "";
                if (node.firstChild) node.removeChild(node.firstChild);
            }
        }
    }
    var tbody = table.getElementsByTagName("tbody").item(0);
    for (var i = 0; (node = tbody.getElementsByTagName("tr").item(i)); i++) {
        a[i] = new Array();
        a[i][0] = getConcatenedTextContent(node.getElementsByTagName("td").item(curcol));
        a[i][1] = getConcatenedTextContent(node.getElementsByTagName("td").item(1));
        a[i][2] = getConcatenedTextContent(node.getElementsByTagName("td").item(0));
        a[i][3] = node;
    }
    a.sort(_sort);
    if (table.up) a.reverse();
    for (var i = 0; i < a.length; i++) {
        tbody.appendChild(a[i][3]);
a[i][3].className = (i % 2 == 0 ? "tbl1" : "tbl2");
    }
}
function init(e) {
    for (var j = 0; (thead = document.getElementsByTagName("thead").item(j)); j++) {
        var node;
        for (var i = 0; (node = thead.getElementsByTagName("td").item(i)); i++) {
 if (node.className != "none") {
            if (node.addEventListener) node.addEventListener("click", sort, false);
            else if (node.attachEvent) node.attachEvent("onclick", sort);
 }
        }
        thead.parentNode.up = 0;
        
        if (typeof(initial_sort_id) != "undefined"){
            td_for_event = thead.getElementsByTagName("td").item(initial_sort_id);
            if (document.createEvent){
                var evt = document.createEvent("MouseEvents");
                evt.initMouseEvent("click", false, false, window, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, td_for_event);
                td_for_event.dispatchEvent(evt);
            } else if (td_for_event.fireEvent) td_for_event.fireEvent("onclick");
            if (typeof(initial_sort_up) != "undefined" && initial_sort_up){
                if (td_for_event.dispatchEvent) td_for_event.dispatchEvent(evt);
                else if (td_for_event.fireEvent) td_for_event.fireEvent("onclick");
            }
        }
    }
}
