var OK = false;
var remove_func;
var set_focus = '';
var config = {
    'template_dir' : 'default'
}
var GB_ROOT_DIR = "/js/GreyBox/";
var isIE  = (navigator.appVersion.indexOf("MSIE") != -1) ? true : false;
var isIE6 = (navigator.userAgent.indexOf("MSIE 6.0") != -1) ? true : false;
var isOpera = (navigator.userAgent.indexOf("Opera") != -1) ? true : false;

/*!
 * jQuery JavaScript Library v1.4.2
 * http://jquery.com/
 *
 * Copyright 2010, John Resig
 * Dual licensed under the MIT or GPL Version 2 licenses.
 * http://jquery.org/license
 *
 * Includes Sizzle.js
 * http://sizzlejs.com/
 * Copyright 2010, The Dojo Foundation
 * Released under the MIT, BSD, and GPL Licenses.
 *
 * Date: Sat Feb 13 22:33:48 2010 -0500
 */
(function(A,w){
    function ma(){
        if(!c.isReady){
            try{
                s.documentElement.doScroll("left")
            }catch(a){
                setTimeout(ma,1);
                return
            }
            c.ready()
        }
    }
    function Qa(a,b){
        b.src?c.ajax({
            url:b.src,
            async:false,
            dataType:"script"
        }):c.globalEval(b.text||b.textContent||b.innerHTML||"");
        b.parentNode&&b.parentNode.removeChild(b)
    }
    function X(a,b,d,f,e,j){
        var i=a.length;
        if(typeof b==="object"){
            for(var o in b)X(a,o,b[o],f,e,d);return a
        }
        if(d!==w){
            f=!j&&f&&c.isFunction(d);
            for(o=0;o<i;o++)e(a[o],b,f?d.call(a[o],o,e(a[o],b)):d,j);
            return a
        }
        return i?
        e(a[0],b):w
    }
    function J(){
        return(new Date).getTime()
    }
    function Y(){
        return false
    }
    function Z(){
        return true
    }
    function na(a,b,d){
        d[0].type=a;
        return c.event.handle.apply(b,d)
    }
    function oa(a){
        var b,d=[],f=[],e=arguments,j,i,o,k,n,r;
        i=c.data(this,"events");
        if(!(a.liveFired===this||!i||!i.live||a.button&&a.type==="click")){
            a.liveFired=this;
            var u=i.live.slice(0);
            for(k=0;k<u.length;k++){
                i=u[k];
                i.origType.replace(O,"")===a.type?f.push(i.selector):u.splice(k--,1)
            }
            j=c(a.target).closest(f,a.currentTarget);
            n=0;
            for(r=
                j.length;n<r;n++)for(k=0;k<u.length;k++){
                i=u[k];
                if(j[n].selector===i.selector){
                    o=j[n].elem;
                    f=null;
                    if(i.preType==="mouseenter"||i.preType==="mouseleave")f=c(a.relatedTarget).closest(i.selector)[0];
                    if(!f||f!==o)d.push({
                        elem:o,
                        handleObj:i
                    })
                }
            }
            n=0;
            for(r=d.length;n<r;n++){
                j=d[n];
                a.currentTarget=j.elem;
                a.data=j.handleObj.data;
                a.handleObj=j.handleObj;
                if(j.handleObj.origHandler.apply(j.elem,e)===false){
                    b=false;
                    break
                }
            }
            return b
        }
    }
    function pa(a,b){
        return"live."+(a&&a!=="*"?a+".":"")+b.replace(/\./g,"`").replace(/ /g,
            "&")
    }
    function qa(a){
        return!a||!a.parentNode||a.parentNode.nodeType===11
    }
    function ra(a,b){
        var d=0;
        b.each(function(){
            if(this.nodeName===(a[d]&&a[d].nodeName)){
                var f=c.data(a[d++]),e=c.data(this,f);
                if(f=f&&f.events){
                    delete e.handle;
                    e.events={};
                
                    for(var j in f)for(var i in f[j])c.event.add(this,j,f[j][i],f[j][i].data)
                }
            }
        })
    }
    function sa(a,b,d){
        var f,e,j;
        b=b&&b[0]?b[0].ownerDocument||b[0]:s;
        if(a.length===1&&typeof a[0]==="string"&&a[0].length<512&&b===s&&!ta.test(a[0])&&(c.support.checkClone||!ua.test(a[0]))){
            e=
            true;
            if(j=c.fragments[a[0]])if(j!==1)f=j
        }
        if(!f){
            f=b.createDocumentFragment();
            c.clean(a,b,f,d)
        }
        if(e)c.fragments[a[0]]=j?f:1;
        return{
            fragment:f,
            cacheable:e
        }
    }
    function K(a,b){
        var d={};
    
        c.each(va.concat.apply([],va.slice(0,b)),function(){
            d[this]=a
        });
        return d
    }
    function wa(a){
        return"scrollTo"in a&&a.document?a:a.nodeType===9?a.defaultView||a.parentWindow:false
    }
    var c=function(a,b){
        return new c.fn.init(a,b)
    },Ra=A.jQuery,Sa=A.$,s=A.document,T,Ta=/^[^<]*(<[\w\W]+>)[^>]*$|^#([\w-]+)$/,Ua=/^.[^:#\[\.,]*$/,Va=/\S/,
    Wa=/^(\s|\u00A0)+|(\s|\u00A0)+$/g,Xa=/^<(\w+)\s*\/?>(?:<\/\1>)?$/,P=navigator.userAgent,xa=false,Q=[],L,$=Object.prototype.toString,aa=Object.prototype.hasOwnProperty,ba=Array.prototype.push,R=Array.prototype.slice,ya=Array.prototype.indexOf;
    c.fn=c.prototype={
        init:function(a,b){
            var d,f;
            if(!a)return this;
            if(a.nodeType){
                this.context=this[0]=a;
                this.length=1;
                return this
            }
            if(a==="body"&&!b){
                this.context=s;
                this[0]=s.body;
                this.selector="body";
                this.length=1;
                return this
            }
            if(typeof a==="string")if((d=Ta.exec(a))&&
                (d[1]||!b))if(d[1]){
                f=b?b.ownerDocument||b:s;
                if(a=Xa.exec(a))if(c.isPlainObject(b)){
                    a=[s.createElement(a[1])];
                    c.fn.attr.call(a,b,true)
                }else a=[f.createElement(a[1])];
                else{
                    a=sa([d[1]],[f]);
                    a=(a.cacheable?a.fragment.cloneNode(true):a.fragment).childNodes
                }
                return c.merge(this,a)
            }else{
                if(b=s.getElementById(d[2])){
                    if(b.id!==d[2])return T.find(a);
                    this.length=1;
                    this[0]=b
                }
                this.context=s;
                this.selector=a;
                return this
            }else if(!b&&/^\w+$/.test(a)){
                this.selector=a;
                this.context=s;
                a=s.getElementsByTagName(a);
                return c.merge(this,
                    a)
            }else return!b||b.jquery?(b||T).find(a):c(b).find(a);
            else if(c.isFunction(a))return T.ready(a);
            if(a.selector!==w){
                this.selector=a.selector;
                this.context=a.context
            }
            return c.makeArray(a,this)
        },
        selector:"",
        jquery:"1.4.2",
        length:0,
        size:function(){
            return this.length
        },
        toArray:function(){
            return R.call(this,0)
        },
        get:function(a){
            return a==null?this.toArray():a<0?this.slice(a)[0]:this[a]
        },
        pushStack:function(a,b,d){
            var f=c();
            c.isArray(a)?ba.apply(f,a):c.merge(f,a);
            f.prevObject=this;
            f.context=this.context;
            if(b===
                "find")f.selector=this.selector+(this.selector?" ":"")+d;
            else if(b)f.selector=this.selector+"."+b+"("+d+")";
            return f
        },
        each:function(a,b){
            return c.each(this,a,b)
        },
        ready:function(a){
            c.bindReady();
            if(c.isReady)a.call(s,c);else Q&&Q.push(a);
            return this
        },
        eq:function(a){
            return a===-1?this.slice(a):this.slice(a,+a+1)
        },
        first:function(){
            return this.eq(0)
        },
        last:function(){
            return this.eq(-1)
        },
        slice:function(){
            return this.pushStack(R.apply(this,arguments),"slice",R.call(arguments).join(","))
        },
        map:function(a){
            return this.pushStack(c.map(this,
                function(b,d){
                    return a.call(b,d,b)
                }))
        },
        end:function(){
            return this.prevObject||c(null)
        },
        push:ba,
        sort:[].sort,
        splice:[].splice
    };
    c.fn.init.prototype=c.fn;
    c.extend=c.fn.extend=function(){
        var a=arguments[0]||{},b=1,d=arguments.length,f=false,e,j,i,o;
        if(typeof a==="boolean"){
            f=a;
            a=arguments[1]||{};
            b=2
        }
        if(typeof a!=="object"&&!c.isFunction(a))a={};
        if(d===b){
            a=this;
            --b
        }
        for(;b<d;b++)if((e=arguments[b])!=null)for(j in e){
            i=a[j];
            o=e[j];
            if(a!==o)if(f&&o&&(c.isPlainObject(o)||c.isArray(o))){
                i=i&&(c.isPlainObject(i)||
                    c.isArray(i))?i:c.isArray(o)?[]:{};
                a[j]=c.extend(f,i,o)
            }else if(o!==w)a[j]=o
        }
        return a
    };

    c.extend({
        noConflict:function(a){
            A.$=Sa;
            if(a)A.jQuery=Ra;
            return c
        },
        isReady:false,
        ready:function(){
            if(!c.isReady){
                if(!s.body)return setTimeout(c.ready,13);
                c.isReady=true;
                if(Q){
                    for(var a,b=0;a=Q[b++];)a.call(s,c);
                    Q=null
                }
                c.fn.triggerHandler&&c(s).triggerHandler("ready")
            }
        },
        bindReady:function(){
            if(!xa){
                xa=true;
                if(s.readyState==="complete")return c.ready();
                if(s.addEventListener){
                    s.addEventListener("DOMContentLoaded",
                        L,false);
                    A.addEventListener("load",c.ready,false)
                }else if(s.attachEvent){
                    s.attachEvent("onreadystatechange",L);
                    A.attachEvent("onload",c.ready);
                    var a=false;
                    try{
                        a=A.frameElement==null
                    }catch(b){}
                    s.documentElement.doScroll&&a&&ma()
                }
            }
        },
        isFunction:function(a){
            return $.call(a)==="[object Function]"
        },
        isArray:function(a){
            return $.call(a)==="[object Array]"
        },
        isPlainObject:function(a){
            if(!a||$.call(a)!=="[object Object]"||a.nodeType||a.setInterval)return false;
            if(a.constructor&&!aa.call(a,"constructor")&&!aa.call(a.constructor.prototype,
                "isPrototypeOf"))return false;
            var b;
            for(b in a);return b===w||aa.call(a,b)
        },
        isEmptyObject:function(a){
            for(var b in a)return false;return true
        },
        error:function(a){
            throw a;
        },
        parseJSON:function(a){
            if(typeof a!=="string"||!a)return null;
            a=c.trim(a);
            if(/^[\],:{}\s]*$/.test(a.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,"@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,"]").replace(/(?:^|:|,)(?:\s*\[)+/g,"")))return A.JSON&&A.JSON.parse?A.JSON.parse(a):(new Function("return "+
                a))();else c.error("Invalid JSON: "+a)
        },
        noop:function(){},
        globalEval:function(a){
            if(a&&Va.test(a)){
                var b=s.getElementsByTagName("head")[0]||s.documentElement,d=s.createElement("script");
                d.type="text/javascript";
                if(c.support.scriptEval)d.appendChild(s.createTextNode(a));else d.text=a;
                b.insertBefore(d,b.firstChild);
                b.removeChild(d)
            }
        },
        nodeName:function(a,b){
            return a.nodeName&&a.nodeName.toUpperCase()===b.toUpperCase()
        },
        each:function(a,b,d){
            var f,e=0,j=a.length,i=j===w||c.isFunction(a);
            if(d)if(i)for(f in a){
                if(b.apply(a[f],
                    d)===false)break
            }else for(;e<j;){
                if(b.apply(a[e++],d)===false)break
            }else if(i)for(f in a){
                if(b.call(a[f],f,a[f])===false)break
            }else for(d=a[0];e<j&&b.call(d,e,d)!==false;d=a[++e]);
            return a
        },
        trim:function(a){
            return(a||"").replace(Wa,"")
        },
        makeArray:function(a,b){
            b=b||[];
            if(a!=null)a.length==null||typeof a==="string"||c.isFunction(a)||typeof a!=="function"&&a.setInterval?ba.call(b,a):c.merge(b,a);
            return b
        },
        inArray:function(a,b){
            if(b.indexOf)return b.indexOf(a);
            for(var d=0,f=b.length;d<f;d++)if(b[d]===
                a)return d;return-1
        },
        merge:function(a,b){
            var d=a.length,f=0;
            if(typeof b.length==="number")for(var e=b.length;f<e;f++)a[d++]=b[f];else for(;b[f]!==w;)a[d++]=b[f++];
            a.length=d;
            return a
        },
        grep:function(a,b,d){
            for(var f=[],e=0,j=a.length;e<j;e++)!d!==!b(a[e],e)&&f.push(a[e]);
            return f
        },
        map:function(a,b,d){
            for(var f=[],e,j=0,i=a.length;j<i;j++){
                e=b(a[j],j,d);
                if(e!=null)f[f.length]=e
            }
            return f.concat.apply([],f)
        },
        guid:1,
        proxy:function(a,b,d){
            if(arguments.length===2)if(typeof b==="string"){
                d=a;
                a=d[b];
                b=w
            }else if(b&&
                !c.isFunction(b)){
                d=b;
                b=w
            }
            if(!b&&a)b=function(){
                return a.apply(d||this,arguments)
            };
        
            if(a)b.guid=a.guid=a.guid||b.guid||c.guid++;
            return b
        },
        uaMatch:function(a){
            a=a.toLowerCase();
            a=/(webkit)[ \/]([\w.]+)/.exec(a)||/(opera)(?:.*version)?[ \/]([\w.]+)/.exec(a)||/(msie) ([\w.]+)/.exec(a)||!/compatible/.test(a)&&/(mozilla)(?:.*? rv:([\w.]+))?/.exec(a)||[];
            return{
                browser:a[1]||"",
                version:a[2]||"0"
            }
        },
        browser:{}
    });
    P=c.uaMatch(P);
    if(P.browser){
        c.browser[P.browser]=true;
        c.browser.version=P.version
    }
    if(c.browser.webkit)c.browser.safari=
        true;
    if(ya)c.inArray=function(a,b){
        return ya.call(b,a)
    };
    
    T=c(s);
    if(s.addEventListener)L=function(){
        s.removeEventListener("DOMContentLoaded",L,false);
        c.ready()
    };
    else if(s.attachEvent)L=function(){
        if(s.readyState==="complete"){
            s.detachEvent("onreadystatechange",L);
            c.ready()
        }
    };
    (function(){
        c.support={};
    
        var a=s.documentElement,b=s.createElement("script"),d=s.createElement("div"),f="script"+J();
        d.style.display="none";
        d.innerHTML="   <link/><table></table><a href='/a' style='color:red;float:left;opacity:.55;'>a</a><input type='checkbox'/>";
        var e=d.getElementsByTagName("*"),j=d.getElementsByTagName("a")[0];
        if(!(!e||!e.length||!j)){
            c.support={
                leadingWhitespace:d.firstChild.nodeType===3,
                tbody:!d.getElementsByTagName("tbody").length,
                htmlSerialize:!!d.getElementsByTagName("link").length,
                style:/red/.test(j.getAttribute("style")),
                hrefNormalized:j.getAttribute("href")==="/a",
                opacity:/^0.55$/.test(j.style.opacity),
                cssFloat:!!j.style.cssFloat,
                checkOn:d.getElementsByTagName("input")[0].value==="on",
                optSelected:s.createElement("select").appendChild(s.createElement("option")).selected,
                parentNode:d.removeChild(d.appendChild(s.createElement("div"))).parentNode===null,
                deleteExpando:true,
                checkClone:false,
                scriptEval:false,
                noCloneEvent:true,
                boxModel:null
            };
        
            b.type="text/javascript";
            try{
                b.appendChild(s.createTextNode("window."+f+"=1;"))
            }catch(i){}
            a.insertBefore(b,a.firstChild);
            if(A[f]){
                c.support.scriptEval=true;
                delete A[f]
            }
            try{
                delete b.test
            }catch(o){
                c.support.deleteExpando=false
            }
            a.removeChild(b);
            if(d.attachEvent&&d.fireEvent){
                d.attachEvent("onclick",function k(){
                    c.support.noCloneEvent=
                    false;
                    d.detachEvent("onclick",k)
                });
                d.cloneNode(true).fireEvent("onclick")
            }
            d=s.createElement("div");
            d.innerHTML="<input type='radio' name='radiotest' checked='checked'/>";
            a=s.createDocumentFragment();
            a.appendChild(d.firstChild);
            c.support.checkClone=a.cloneNode(true).cloneNode(true).lastChild.checked;
            c(function(){
                var k=s.createElement("div");
                k.style.width=k.style.paddingLeft="1px";
                s.body.appendChild(k);
                c.boxModel=c.support.boxModel=k.offsetWidth===2;
                s.body.removeChild(k).style.display="none"
            });
            a=function(k){
                var n=
                s.createElement("div");
                k="on"+k;
                var r=k in n;
                if(!r){
                    n.setAttribute(k,"return;");
                    r=typeof n[k]==="function"
                }
                return r
            };
            
            c.support.submitBubbles=a("submit");
            c.support.changeBubbles=a("change");
            a=b=d=e=j=null
        }
    })();
    c.props={
        "for":"htmlFor",
        "class":"className",
        readonly:"readOnly",
        maxlength:"maxLength",
        cellspacing:"cellSpacing",
        rowspan:"rowSpan",
        colspan:"colSpan",
        tabindex:"tabIndex",
        usemap:"useMap",
        frameborder:"frameBorder"
    };

    var G="jQuery"+J(),Ya=0,za={};

    c.extend({
        cache:{},
        expando:G,
        noData:{
            embed:true,
            object:true,
            applet:true
        },
        data:function(a,b,d){
            if(!(a.nodeName&&c.noData[a.nodeName.toLowerCase()])){
                a=a==A?za:a;
                var f=a[G],e=c.cache;
                if(!f&&typeof b==="string"&&d===w)return null;
                f||(f=++Ya);
                if(typeof b==="object"){
                    a[G]=f;
                    e[f]=c.extend(true,{},b)
                }else if(!e[f]){
                    a[G]=f;
                    e[f]={}
                }
                a=e[f];
                if(d!==w)a[b]=d;
                return typeof b==="string"?a[b]:a
            }
        },
        removeData:function(a,b){
            if(!(a.nodeName&&c.noData[a.nodeName.toLowerCase()])){
                a=a==A?za:a;
                var d=a[G],f=c.cache,e=f[d];
                if(b){
                    if(e){
                        delete e[b];
                        c.isEmptyObject(e)&&c.removeData(a)
                    }
                }else{
                    if(c.support.deleteExpando)delete a[c.expando];
                    else a.removeAttribute&&a.removeAttribute(c.expando);
                    delete f[d]
                }
            }
        }
    });
    c.fn.extend({
        data:function(a,b){
            if(typeof a==="undefined"&&this.length)return c.data(this[0]);
            else if(typeof a==="object")return this.each(function(){
                c.data(this,a)
            });
            var d=a.split(".");
            d[1]=d[1]?"."+d[1]:"";
            if(b===w){
                var f=this.triggerHandler("getData"+d[1]+"!",[d[0]]);
                if(f===w&&this.length)f=c.data(this[0],a);
                return f===w&&d[1]?this.data(d[0]):f
            }else return this.trigger("setData"+d[1]+"!",[d[0],b]).each(function(){
                c.data(this,
                    a,b)
            })
        },
        removeData:function(a){
            return this.each(function(){
                c.removeData(this,a)
            })
        }
    });
    c.extend({
        queue:function(a,b,d){
            if(a){
                b=(b||"fx")+"queue";
                var f=c.data(a,b);
                if(!d)return f||[];
                if(!f||c.isArray(d))f=c.data(a,b,c.makeArray(d));else f.push(d);
                return f
            }
        },
        dequeue:function(a,b){
            b=b||"fx";
            var d=c.queue(a,b),f=d.shift();
            if(f==="inprogress")f=d.shift();
            if(f){
                b==="fx"&&d.unshift("inprogress");
                f.call(a,function(){
                    c.dequeue(a,b)
                })
            }
        }
    });
    c.fn.extend({
        queue:function(a,b){
            if(typeof a!=="string"){
                b=a;
                a="fx"
            }
            if(b===
                w)return c.queue(this[0],a);
            return this.each(function(){
                var d=c.queue(this,a,b);
                a==="fx"&&d[0]!=="inprogress"&&c.dequeue(this,a)
            })
        },
        dequeue:function(a){
            return this.each(function(){
                c.dequeue(this,a)
            })
        },
        delay:function(a,b){
            a=c.fx?c.fx.speeds[a]||a:a;
            b=b||"fx";
            return this.queue(b,function(){
                var d=this;
                setTimeout(function(){
                    c.dequeue(d,b)
                },a)
            })
        },
        clearQueue:function(a){
            return this.queue(a||"fx",[])
        }
    });
    var Aa=/[\n\t]/g,ca=/\s+/,Za=/\r/g,$a=/href|src|style/,ab=/(button|input)/i,bb=/(button|input|object|select|textarea)/i,
    cb=/^(a|area)$/i,Ba=/radio|checkbox/;
    c.fn.extend({
        attr:function(a,b){
            return X(this,a,b,true,c.attr)
        },
        removeAttr:function(a){
            return this.each(function(){
                c.attr(this,a,"");
                this.nodeType===1&&this.removeAttribute(a)
            })
        },
        addClass:function(a){
            if(c.isFunction(a))return this.each(function(n){
                var r=c(this);
                r.addClass(a.call(this,n,r.attr("class")))
            });
            if(a&&typeof a==="string")for(var b=(a||"").split(ca),d=0,f=this.length;d<f;d++){
                var e=this[d];
                if(e.nodeType===1)if(e.className){
                    for(var j=" "+e.className+" ",
                        i=e.className,o=0,k=b.length;o<k;o++)if(j.indexOf(" "+b[o]+" ")<0)i+=" "+b[o];e.className=c.trim(i)
                }else e.className=a
            }
            return this
        },
        removeClass:function(a){
            if(c.isFunction(a))return this.each(function(k){
                var n=c(this);
                n.removeClass(a.call(this,k,n.attr("class")))
            });
            if(a&&typeof a==="string"||a===w)for(var b=(a||"").split(ca),d=0,f=this.length;d<f;d++){
                var e=this[d];
                if(e.nodeType===1&&e.className)if(a){
                    for(var j=(" "+e.className+" ").replace(Aa," "),i=0,o=b.length;i<o;i++)j=j.replace(" "+b[i]+" ",
                        " ");
                    e.className=c.trim(j)
                }else e.className=""
            }
            return this
        },
        toggleClass:function(a,b){
            var d=typeof a,f=typeof b==="boolean";
            if(c.isFunction(a))return this.each(function(e){
                var j=c(this);
                j.toggleClass(a.call(this,e,j.attr("class"),b),b)
            });
            return this.each(function(){
                if(d==="string")for(var e,j=0,i=c(this),o=b,k=a.split(ca);e=k[j++];){
                    o=f?o:!i.hasClass(e);
                    i[o?"addClass":"removeClass"](e)
                }else if(d==="undefined"||d==="boolean"){
                    this.className&&c.data(this,"__className__",this.className);
                    this.className=
                    this.className||a===false?"":c.data(this,"__className__")||""
                }
            })
        },
        hasClass:function(a){
            a=" "+a+" ";
            for(var b=0,d=this.length;b<d;b++)if((" "+this[b].className+" ").replace(Aa," ").indexOf(a)>-1)return true;return false
        },
        val:function(a){
            if(a===w){
                var b=this[0];
                if(b){
                    if(c.nodeName(b,"option"))return(b.attributes.value||{}).specified?b.value:b.text;
                    if(c.nodeName(b,"select")){
                        var d=b.selectedIndex,f=[],e=b.options;
                        b=b.type==="select-one";
                        if(d<0)return null;
                        var j=b?d:0;
                        for(d=b?d+1:e.length;j<d;j++){
                            var i=
                            e[j];
                            if(i.selected){
                                a=c(i).val();
                                if(b)return a;
                                f.push(a)
                            }
                        }
                        return f
                    }
                    if(Ba.test(b.type)&&!c.support.checkOn)return b.getAttribute("value")===null?"on":b.value;
                    return(b.value||"").replace(Za,"")
                }
                return w
            }
            var o=c.isFunction(a);
            return this.each(function(k){
                var n=c(this),r=a;
                if(this.nodeType===1){
                    if(o)r=a.call(this,k,n.val());
                    if(typeof r==="number")r+="";
                    if(c.isArray(r)&&Ba.test(this.type))this.checked=c.inArray(n.val(),r)>=0;
                    else if(c.nodeName(this,"select")){
                        var u=c.makeArray(r);
                        c("option",this).each(function(){
                            this.selected=
                            c.inArray(c(this).val(),u)>=0
                        });
                        if(!u.length)this.selectedIndex=-1
                    }else this.value=r
                }
            })
        }
    });
    c.extend({
        attrFn:{
            val:true,
            css:true,
            html:true,
            text:true,
            data:true,
            width:true,
            height:true,
            offset:true
        },
        attr:function(a,b,d,f){
            if(!a||a.nodeType===3||a.nodeType===8)return w;
            if(f&&b in c.attrFn)return c(a)[b](d);
            f=a.nodeType!==1||!c.isXMLDoc(a);
            var e=d!==w;
            b=f&&c.props[b]||b;
            if(a.nodeType===1){
                var j=$a.test(b);
                if(b in a&&f&&!j){
                    if(e){
                        b==="type"&&ab.test(a.nodeName)&&a.parentNode&&c.error("type property can't be changed");
                        a[b]=d
                    }
                    if(c.nodeName(a,"form")&&a.getAttributeNode(b))return a.getAttributeNode(b).nodeValue;
                    if(b==="tabIndex")return(b=a.getAttributeNode("tabIndex"))&&b.specified?b.value:bb.test(a.nodeName)||cb.test(a.nodeName)&&a.href?0:w;
                    return a[b]
                }
                if(!c.support.style&&f&&b==="style"){
                    if(e)a.style.cssText=""+d;
                    return a.style.cssText
                }
                e&&a.setAttribute(b,""+d);
                a=!c.support.hrefNormalized&&f&&j?a.getAttribute(b,2):a.getAttribute(b);
                return a===null?w:a
            }
            return c.style(a,b,d)
        }
    });
    var O=/\.(.*)$/,db=function(a){
        return a.replace(/[^\w\s\.\|`]/g,
            function(b){
                return"\\"+b
            })
    };
    
    c.event={
        add:function(a,b,d,f){
            if(!(a.nodeType===3||a.nodeType===8)){
                if(a.setInterval&&a!==A&&!a.frameElement)a=A;
                var e,j;
                if(d.handler){
                    e=d;
                    d=e.handler
                }
                if(!d.guid)d.guid=c.guid++;
                if(j=c.data(a)){
                    var i=j.events=j.events||{},o=j.handle;
                    if(!o)j.handle=o=function(){
                        return typeof c!=="undefined"&&!c.event.triggered?c.event.handle.apply(o.elem,arguments):w
                    };
                    
                    o.elem=a;
                    b=b.split(" ");
                    for(var k,n=0,r;k=b[n++];){
                        j=e?c.extend({},e):{
                            handler:d,
                            data:f
                        };
                    
                        if(k.indexOf(".")>-1){
                            r=k.split(".");
                            k=r.shift();
                            j.namespace=r.slice(0).sort().join(".")
                        }else{
                            r=[];
                            j.namespace=""
                        }
                        j.type=k;
                        j.guid=d.guid;
                        var u=i[k],z=c.event.special[k]||{};
                    
                        if(!u){
                            u=i[k]=[];
                            if(!z.setup||z.setup.call(a,f,r,o)===false)if(a.addEventListener)a.addEventListener(k,o,false);else a.attachEvent&&a.attachEvent("on"+k,o)
                        }
                        if(z.add){
                            z.add.call(a,j);
                            if(!j.handler.guid)j.handler.guid=d.guid
                        }
                        u.push(j);
                        c.event.global[k]=true
                    }
                    a=null
                }
            }
        },
        global:{},
        remove:function(a,b,d,f){
            if(!(a.nodeType===3||a.nodeType===8)){
                var e,j=0,i,o,k,n,r,u,z=c.data(a),
                C=z&&z.events;
                if(z&&C){
                    if(b&&b.type){
                        d=b.handler;
                        b=b.type
                    }
                    if(!b||typeof b==="string"&&b.charAt(0)==="."){
                        b=b||"";
                        for(e in C)c.event.remove(a,e+b)
                    }else{
                        for(b=b.split(" ");e=b[j++];){
                            n=e;
                            i=e.indexOf(".")<0;
                            o=[];
                            if(!i){
                                o=e.split(".");
                                e=o.shift();
                                k=new RegExp("(^|\\.)"+c.map(o.slice(0).sort(),db).join("\\.(?:.*\\.)?")+"(\\.|$)")
                            }
                            if(r=C[e])if(d){
                                n=c.event.special[e]||{};
                        
                                for(B=f||0;B<r.length;B++){
                                    u=r[B];
                                    if(d.guid===u.guid){
                                        if(i||k.test(u.namespace)){
                                            f==null&&r.splice(B--,1);
                                            n.remove&&n.remove.call(a,u)
                                        }
                                        if(f!=
                                            null)break
                                    }
                                }
                                if(r.length===0||f!=null&&r.length===1){
                                    if(!n.teardown||n.teardown.call(a,o)===false)Ca(a,e,z.handle);
                                    delete C[e]
                                }
                            }else for(var B=0;B<r.length;B++){
                                u=r[B];
                                if(i||k.test(u.namespace)){
                                    c.event.remove(a,n,u.handler,B);
                                    r.splice(B--,1)
                                }
                            }
                        }
                        if(c.isEmptyObject(C)){
                            if(b=z.handle)b.elem=null;
                            delete z.events;
                            delete z.handle;
                            c.isEmptyObject(z)&&c.removeData(a)
                        }
                    }
                }
            }
        },
        trigger:function(a,b,d,f){
            var e=a.type||a;
            if(!f){
                a=typeof a==="object"?a[G]?a:c.extend(c.Event(e),a):c.Event(e);
                if(e.indexOf("!")>=0){
                    a.type=
                    e=e.slice(0,-1);
                    a.exclusive=true
                }
                if(!d){
                    a.stopPropagation();
                    c.event.global[e]&&c.each(c.cache,function(){
                        this.events&&this.events[e]&&c.event.trigger(a,b,this.handle.elem)
                    })
                }
                if(!d||d.nodeType===3||d.nodeType===8)return w;
                a.result=w;
                a.target=d;
                b=c.makeArray(b);
                b.unshift(a)
            }
            a.currentTarget=d;
            (f=c.data(d,"handle"))&&f.apply(d,b);
            f=d.parentNode||d.ownerDocument;
            try{
                if(!(d&&d.nodeName&&c.noData[d.nodeName.toLowerCase()]))if(d["on"+e]&&d["on"+e].apply(d,b)===false)a.result=false
            }catch(j){}
            if(!a.isPropagationStopped()&&
                f)c.event.trigger(a,b,f,true);
            else if(!a.isDefaultPrevented()){
                f=a.target;
                var i,o=c.nodeName(f,"a")&&e==="click",k=c.event.special[e]||{};
        
                if((!k._default||k._default.call(d,a)===false)&&!o&&!(f&&f.nodeName&&c.noData[f.nodeName.toLowerCase()])){
                    try{
                        if(f[e]){
                            if(i=f["on"+e])f["on"+e]=null;
                            c.event.triggered=true;
                            f[e]()
                        }
                    }catch(n){}
                    if(i)f["on"+e]=i;
                    c.event.triggered=false
                }
            }
        },
        handle:function(a){
            var b,d,f,e;
            a=arguments[0]=c.event.fix(a||A.event);
            a.currentTarget=this;
            b=a.type.indexOf(".")<0&&!a.exclusive;
            if(!b){
                d=a.type.split(".");
                a.type=d.shift();
                f=new RegExp("(^|\\.)"+d.slice(0).sort().join("\\.(?:.*\\.)?")+"(\\.|$)")
            }
            e=c.data(this,"events");
            d=e[a.type];
            if(e&&d){
                d=d.slice(0);
                e=0;
                for(var j=d.length;e<j;e++){
                    var i=d[e];
                    if(b||f.test(i.namespace)){
                        a.handler=i.handler;
                        a.data=i.data;
                        a.handleObj=i;
                        i=i.handler.apply(this,arguments);
                        if(i!==w){
                            a.result=i;
                            if(i===false){
                                a.preventDefault();
                                a.stopPropagation()
                            }
                        }
                        if(a.isImmediatePropagationStopped())break
                    }
                }
            }
            return a.result
        },
        props:"altKey attrChange attrName bubbles button cancelable charCode clientX clientY ctrlKey currentTarget data detail eventPhase fromElement handler keyCode layerX layerY metaKey newValue offsetX offsetY originalTarget pageX pageY prevValue relatedNode relatedTarget screenX screenY shiftKey srcElement target toElement view wheelDelta which".split(" "),
        fix:function(a){
            if(a[G])return a;
            var b=a;
            a=c.Event(b);
            for(var d=this.props.length,f;d;){
                f=this.props[--d];
                a[f]=b[f]
            }
            if(!a.target)a.target=a.srcElement||s;
            if(a.target.nodeType===3)a.target=a.target.parentNode;
            if(!a.relatedTarget&&a.fromElement)a.relatedTarget=a.fromElement===a.target?a.toElement:a.fromElement;
            if(a.pageX==null&&a.clientX!=null){
                b=s.documentElement;
                d=s.body;
                a.pageX=a.clientX+(b&&b.scrollLeft||d&&d.scrollLeft||0)-(b&&b.clientLeft||d&&d.clientLeft||0);
                a.pageY=a.clientY+(b&&b.scrollTop||
                    d&&d.scrollTop||0)-(b&&b.clientTop||d&&d.clientTop||0)
            }
            if(!a.which&&(a.charCode||a.charCode===0?a.charCode:a.keyCode))a.which=a.charCode||a.keyCode;
            if(!a.metaKey&&a.ctrlKey)a.metaKey=a.ctrlKey;
            if(!a.which&&a.button!==w)a.which=a.button&1?1:a.button&2?3:a.button&4?2:0;
            return a
        },
        guid:1E8,
        proxy:c.proxy,
        special:{
            ready:{
                setup:c.bindReady,
                teardown:c.noop
            },
            live:{
                add:function(a){
                    c.event.add(this,a.origType,c.extend({},a,{
                        handler:oa
                    }))
                },
                remove:function(a){
                    var b=true,d=a.origType.replace(O,"");
                    c.each(c.data(this,
                        "events").live||[],function(){
                        if(d===this.origType.replace(O,""))return b=false
                    });
                    b&&c.event.remove(this,a.origType,oa)
                }
            },
            beforeunload:{
                setup:function(a,b,d){
                    if(this.setInterval)this.onbeforeunload=d;
                    return false
                },
                teardown:function(a,b){
                    if(this.onbeforeunload===b)this.onbeforeunload=null
                }
            }
        }
    };

    var Ca=s.removeEventListener?function(a,b,d){
        a.removeEventListener(b,d,false)
    }:function(a,b,d){
        a.detachEvent("on"+b,d)
    };
    
    c.Event=function(a){
        if(!this.preventDefault)return new c.Event(a);
        if(a&&a.type){
            this.originalEvent=
            a;
            this.type=a.type
        }else this.type=a;
        this.timeStamp=J();
        this[G]=true
    };
    
    c.Event.prototype={
        preventDefault:function(){
            this.isDefaultPrevented=Z;
            var a=this.originalEvent;
            if(a){
                a.preventDefault&&a.preventDefault();
                a.returnValue=false
            }
        },
        stopPropagation:function(){
            this.isPropagationStopped=Z;
            var a=this.originalEvent;
            if(a){
                a.stopPropagation&&a.stopPropagation();
                a.cancelBubble=true
            }
        },
        stopImmediatePropagation:function(){
            this.isImmediatePropagationStopped=Z;
            this.stopPropagation()
        },
        isDefaultPrevented:Y,
        isPropagationStopped:Y,
        isImmediatePropagationStopped:Y
    };

    var Da=function(a){
        var b=a.relatedTarget;
        try{
            for(;b&&b!==this;)b=b.parentNode;
            if(b!==this){
                a.type=a.data;
                c.event.handle.apply(this,arguments)
            }
        }catch(d){}
    },Ea=function(a){
        a.type=a.data;
        c.event.handle.apply(this,arguments)
    };
    
    c.each({
        mouseenter:"mouseover",
        mouseleave:"mouseout"
    },function(a,b){
        c.event.special[a]={
            setup:function(d){
                c.event.add(this,b,d&&d.selector?Ea:Da,a)
            },
            teardown:function(d){
                c.event.remove(this,b,d&&d.selector?Ea:Da)
            }
        }
    });
    if(!c.support.submitBubbles)c.event.special.submit=

    {
            setup:function(){
                if(this.nodeName.toLowerCase()!=="form"){
                    c.event.add(this,"click.specialSubmit",function(a){
                        var b=a.target,d=b.type;
                        if((d==="submit"||d==="image")&&c(b).closest("form").length)return na("submit",this,arguments)
                    });
                    c.event.add(this,"keypress.specialSubmit",function(a){
                        var b=a.target,d=b.type;
                        if((d==="text"||d==="password")&&c(b).closest("form").length&&a.keyCode===13)return na("submit",this,arguments)
                    })
                }else return false
            },
            teardown:function(){
                c.event.remove(this,".specialSubmit")
            }
        };
    if(!c.support.changeBubbles){
        var da=/textarea|input|select/i,ea,Fa=function(a){
            var b=a.type,d=a.value;
            if(b==="radio"||b==="checkbox")d=a.checked;
            else if(b==="select-multiple")d=a.selectedIndex>-1?c.map(a.options,function(f){
                return f.selected
            }).join("-"):"";
            else if(a.nodeName.toLowerCase()==="select")d=a.selectedIndex;
            return d
        },fa=function(a,b){
            var d=a.target,f,e;
            if(!(!da.test(d.nodeName)||d.readOnly)){
                f=c.data(d,"_change_data");
                e=Fa(d);
                if(a.type!=="focusout"||d.type!=="radio")c.data(d,"_change_data",
                    e);
                if(!(f===w||e===f))if(f!=null||e){
                    a.type="change";
                    return c.event.trigger(a,b,d)
                }
            }
        };

        c.event.special.change={
            filters:{
                focusout:fa,
                click:function(a){
                    var b=a.target,d=b.type;
                    if(d==="radio"||d==="checkbox"||b.nodeName.toLowerCase()==="select")return fa.call(this,a)
                },
                keydown:function(a){
                    var b=a.target,d=b.type;
                    if(a.keyCode===13&&b.nodeName.toLowerCase()!=="textarea"||a.keyCode===32&&(d==="checkbox"||d==="radio")||d==="select-multiple")return fa.call(this,a)
                },
                beforeactivate:function(a){
                    a=a.target;
                    c.data(a,
                        "_change_data",Fa(a))
                }
            },
            setup:function(){
                if(this.type==="file")return false;
                for(var a in ea)c.event.add(this,a+".specialChange",ea[a]);return da.test(this.nodeName)
            },
            teardown:function(){
                c.event.remove(this,".specialChange");
                return da.test(this.nodeName)
            }
        };

        ea=c.event.special.change.filters
    }
    s.addEventListener&&c.each({
        focus:"focusin",
        blur:"focusout"
    },function(a,b){
        function d(f){
            f=c.event.fix(f);
            f.type=b;
            return c.event.handle.call(this,f)
        }
        c.event.special[b]={
            setup:function(){
                this.addEventListener(a,
                    d,true)
            },
            teardown:function(){
                this.removeEventListener(a,d,true)
            }
        }
    });
    c.each(["bind","one"],function(a,b){
        c.fn[b]=function(d,f,e){
            if(typeof d==="object"){
                for(var j in d)this[b](j,f,d[j],e);return this
            }
            if(c.isFunction(f)){
                e=f;
                f=w
            }
            var i=b==="one"?c.proxy(e,function(k){
                c(this).unbind(k,i);
                return e.apply(this,arguments)
            }):e;
            if(d==="unload"&&b!=="one")this.one(d,f,e);
            else{
                j=0;
                for(var o=this.length;j<o;j++)c.event.add(this[j],d,i,f)
            }
            return this
        }
    });
    c.fn.extend({
        unbind:function(a,b){
            if(typeof a==="object"&&
                !a.preventDefault)for(var d in a)this.unbind(d,a[d]);else{
                d=0;
                for(var f=this.length;d<f;d++)c.event.remove(this[d],a,b)
            }
            return this
        },
        delegate:function(a,b,d,f){
            return this.live(b,d,f,a)
        },
        undelegate:function(a,b,d){
            return arguments.length===0?this.unbind("live"):this.die(b,null,d,a)
        },
        trigger:function(a,b){
            return this.each(function(){
                c.event.trigger(a,b,this)
            })
        },
        triggerHandler:function(a,b){
            if(this[0]){
                a=c.Event(a);
                a.preventDefault();
                a.stopPropagation();
                c.event.trigger(a,b,this[0]);
                return a.result
            }
        },
        toggle:function(a){
            for(var b=arguments,d=1;d<b.length;)c.proxy(a,b[d++]);
            return this.click(c.proxy(a,function(f){
                var e=(c.data(this,"lastToggle"+a.guid)||0)%d;
                c.data(this,"lastToggle"+a.guid,e+1);
                f.preventDefault();
                return b[e].apply(this,arguments)||false
            }))
        },
        hover:function(a,b){
            return this.mouseenter(a).mouseleave(b||a)
        }
    });
    var Ga={
        focus:"focusin",
        blur:"focusout",
        mouseenter:"mouseover",
        mouseleave:"mouseout"
    };

    c.each(["live","die"],function(a,b){
        c.fn[b]=function(d,f,e,j){
            var i,o=0,k,n,r=j||this.selector,
            u=j?this:c(this.context);
            if(c.isFunction(f)){
                e=f;
                f=w
            }
            for(d=(d||"").split(" ");(i=d[o++])!=null;){
                j=O.exec(i);
                k="";
                if(j){
                    k=j[0];
                    i=i.replace(O,"")
                }
                if(i==="hover")d.push("mouseenter"+k,"mouseleave"+k);
                else{
                    n=i;
                    if(i==="focus"||i==="blur"){
                        d.push(Ga[i]+k);
                        i+=k
                    }else i=(Ga[i]||i)+k;
                    b==="live"?u.each(function(){
                        c.event.add(this,pa(i,r),{
                            data:f,
                            selector:r,
                            handler:e,
                            origType:i,
                            origHandler:e,
                            preType:n
                        })
                    }):u.unbind(pa(i,r),e)
                }
            }
            return this
        }
    });
    c.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error".split(" "),
        function(a,b){
            c.fn[b]=function(d){
                return d?this.bind(b,d):this.trigger(b)
            };
            
            if(c.attrFn)c.attrFn[b]=true
        });
    A.attachEvent&&!A.addEventListener&&A.attachEvent("onunload",function(){
        for(var a in c.cache)if(c.cache[a].handle)try{
            c.event.remove(c.cache[a].handle.elem)
        }catch(b){}
    });
    (function(){
        function a(g){
            for(var h="",l,m=0;g[m];m++){
                l=g[m];
                if(l.nodeType===3||l.nodeType===4)h+=l.nodeValue;
                else if(l.nodeType!==8)h+=a(l.childNodes)
            }
            return h
        }
        function b(g,h,l,m,q,p){
            q=0;
            for(var v=m.length;q<v;q++){
                var t=m[q];
                if(t){
                    t=t[g];
                    for(var y=false;t;){
                        if(t.sizcache===l){
                            y=m[t.sizset];
                            break
                        }
                        if(t.nodeType===1&&!p){
                            t.sizcache=l;
                            t.sizset=q
                        }
                        if(t.nodeName.toLowerCase()===h){
                            y=t;
                            break
                        }
                        t=t[g]
                    }
                    m[q]=y
                }
            }
        }
        function d(g,h,l,m,q,p){
            q=0;
            for(var v=m.length;q<v;q++){
                var t=m[q];
                if(t){
                    t=t[g];
                    for(var y=false;t;){
                        if(t.sizcache===l){
                            y=m[t.sizset];
                            break
                        }
                        if(t.nodeType===1){
                            if(!p){
                                t.sizcache=l;
                                t.sizset=q
                            }
                            if(typeof h!=="string"){
                                if(t===h){
                                    y=true;
                                    break
                                }
                            }else if(k.filter(h,[t]).length>0){
                                y=t;
                                break
                            }
                        }
                        t=t[g]
                    }
                    m[q]=y
                }
            }
        }
        var f=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^[\]]*\]|['"][^'"]*['"]|[^[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,
        e=0,j=Object.prototype.toString,i=false,o=true;
        [0,0].sort(function(){
            o=false;
            return 0
        });
        var k=function(g,h,l,m){
            l=l||[];
            var q=h=h||s;
            if(h.nodeType!==1&&h.nodeType!==9)return[];
            if(!g||typeof g!=="string")return l;
            for(var p=[],v,t,y,S,H=true,M=x(h),I=g;(f.exec(""),v=f.exec(I))!==null;){
                I=v[3];
                p.push(v[1]);
                if(v[2]){
                    S=v[3];
                    break
                }
            }
            if(p.length>1&&r.exec(g))if(p.length===2&&n.relative[p[0]])t=ga(p[0]+p[1],h);else for(t=n.relative[p[0]]?[h]:k(p.shift(),h);p.length;){
                g=p.shift();
                if(n.relative[g])g+=p.shift();
                t=ga(g,t)
            }else{
                if(!m&&p.length>1&&h.nodeType===9&&!M&&n.match.ID.test(p[0])&&!n.match.ID.test(p[p.length-1])){
                    v=k.find(p.shift(),h,M);
                    h=v.expr?k.filter(v.expr,v.set)[0]:v.set[0]
                }
                if(h){
                    v=m?{
                        expr:p.pop(),
                        set:z(m)
                    }:k.find(p.pop(),p.length===1&&(p[0]==="~"||p[0]==="+")&&h.parentNode?h.parentNode:h,M);
                    t=v.expr?k.filter(v.expr,v.set):v.set;
                    if(p.length>0)y=z(t);else H=false;
                    for(;p.length;){
                        var D=p.pop();
                        v=D;
                        if(n.relative[D])v=p.pop();else D="";
                        if(v==null)v=h;
                        n.relative[D](y,v,M)
                    }
                }else y=[]
            }
            y||(y=t);
            y||k.error(D||
                g);
            if(j.call(y)==="[object Array]")if(H)if(h&&h.nodeType===1)for(g=0;y[g]!=null;g++){
                if(y[g]&&(y[g]===true||y[g].nodeType===1&&E(h,y[g])))l.push(t[g])
            }else for(g=0;y[g]!=null;g++)y[g]&&y[g].nodeType===1&&l.push(t[g]);else l.push.apply(l,y);else z(y,l);
            if(S){
                k(S,q,l,m);
                k.uniqueSort(l)
            }
            return l
        };

        k.uniqueSort=function(g){
            if(B){
                i=o;
                g.sort(B);
                if(i)for(var h=1;h<g.length;h++)g[h]===g[h-1]&&g.splice(h--,1)
            }
            return g
        };
    
        k.matches=function(g,h){
            return k(g,null,null,h)
        };
    
        k.find=function(g,h,l){
            var m,q;
            if(!g)return[];
            for(var p=0,v=n.order.length;p<v;p++){
                var t=n.order[p];
                if(q=n.leftMatch[t].exec(g)){
                    var y=q[1];
                    q.splice(1,1);
                    if(y.substr(y.length-1)!=="\\"){
                        q[1]=(q[1]||"").replace(/\\/g,"");
                        m=n.find[t](q,h,l);
                        if(m!=null){
                            g=g.replace(n.match[t],"");
                            break
                        }
                    }
                }
            }
            m||(m=h.getElementsByTagName("*"));
            return{
                set:m,
                expr:g
            }
        };

        k.filter=function(g,h,l,m){
            for(var q=g,p=[],v=h,t,y,S=h&&h[0]&&x(h[0]);g&&h.length;){
                for(var H in n.filter)if((t=n.leftMatch[H].exec(g))!=null&&t[2]){
                    var M=n.filter[H],I,D;
                    D=t[1];
                    y=false;
                    t.splice(1,1);
                    if(D.substr(D.length-
                        1)!=="\\"){
                        if(v===p)p=[];
                        if(n.preFilter[H])if(t=n.preFilter[H](t,v,l,p,m,S)){
                            if(t===true)continue
                        }else y=I=true;
                        if(t)for(var U=0;(D=v[U])!=null;U++)if(D){
                            I=M(D,t,U,v);
                            var Ha=m^!!I;
                            if(l&&I!=null)if(Ha)y=true;else v[U]=false;
                            else if(Ha){
                                p.push(D);
                                y=true
                            }
                        }
                        if(I!==w){
                            l||(v=p);
                            g=g.replace(n.match[H],"");
                            if(!y)return[];
                            break
                        }
                    }
                }
                if(g===q)if(y==null)k.error(g);else break;
                q=g
            }
            return v
        };

        k.error=function(g){
            throw"Syntax error, unrecognized expression: "+g;
        };

        var n=k.selectors={
            order:["ID","NAME","TAG"],
            match:{
                ID:/#((?:[\w\u00c0-\uFFFF-]|\\.)+)/,
                CLASS:/\.((?:[\w\u00c0-\uFFFF-]|\\.)+)/,
                NAME:/\[name=['"]*((?:[\w\u00c0-\uFFFF-]|\\.)+)['"]*\]/,
                ATTR:/\[\s*((?:[\w\u00c0-\uFFFF-]|\\.)+)\s*(?:(\S?=)\s*(['"]*)(.*?)\3|)\s*\]/,
                TAG:/^((?:[\w\u00c0-\uFFFF\*-]|\\.)+)/,
                CHILD:/:(only|nth|last|first)-child(?:\((even|odd|[\dn+-]*)\))?/,
                POS:/:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^-]|$)/,
                PSEUDO:/:((?:[\w\u00c0-\uFFFF-]|\\.)+)(?:\((['"]?)((?:\([^\)]+\)|[^\(\)]*)+)\2\))?/
            },
            leftMatch:{},
            attrMap:{
                "class":"className",
                "for":"htmlFor"
            },
            attrHandle:{
                href:function(g){
                    return g.getAttribute("href")
                }
            },
            relative:{
                "+":function(g,h){
                    var l=typeof h==="string",m=l&&!/\W/.test(h);
                    l=l&&!m;
                    if(m)h=h.toLowerCase();
                    m=0;
                    for(var q=g.length,p;m<q;m++)if(p=g[m]){
                        for(;(p=p.previousSibling)&&p.nodeType!==1;);
                        g[m]=l||p&&p.nodeName.toLowerCase()===h?p||false:p===h
                    }
                    l&&k.filter(h,g,true)
                },
                ">":function(g,h){
                    var l=typeof h==="string";
                    if(l&&!/\W/.test(h)){
                        h=h.toLowerCase();
                        for(var m=0,q=g.length;m<q;m++){
                            var p=g[m];
                            if(p){
                                l=p.parentNode;
                                g[m]=l.nodeName.toLowerCase()===h?l:false
                            }
                        }
                    }else{
                        m=0;
                        for(q=g.length;m<q;m++)if(p=g[m])g[m]=
                            l?p.parentNode:p.parentNode===h;l&&k.filter(h,g,true)
                    }
                },
                "":function(g,h,l){
                    var m=e++,q=d;
                    if(typeof h==="string"&&!/\W/.test(h)){
                        var p=h=h.toLowerCase();
                        q=b
                    }
                    q("parentNode",h,m,g,p,l)
                },
                "~":function(g,h,l){
                    var m=e++,q=d;
                    if(typeof h==="string"&&!/\W/.test(h)){
                        var p=h=h.toLowerCase();
                        q=b
                    }
                    q("previousSibling",h,m,g,p,l)
                }
            },
            find:{
                ID:function(g,h,l){
                    if(typeof h.getElementById!=="undefined"&&!l)return(g=h.getElementById(g[1]))?[g]:[]
                },
                NAME:function(g,h){
                    if(typeof h.getElementsByName!=="undefined"){
                        var l=[];
                        h=h.getElementsByName(g[1]);
                        for(var m=0,q=h.length;m<q;m++)h[m].getAttribute("name")===g[1]&&l.push(h[m]);
                        return l.length===0?null:l
                    }
                },
                TAG:function(g,h){
                    return h.getElementsByTagName(g[1])
                }
            },
            preFilter:{
                CLASS:function(g,h,l,m,q,p){
                    g=" "+g[1].replace(/\\/g,"")+" ";
                    if(p)return g;
                    p=0;
                    for(var v;(v=h[p])!=null;p++)if(v)if(q^(v.className&&(" "+v.className+" ").replace(/[\t\n]/g," ").indexOf(g)>=0))l||m.push(v);
                        else if(l)h[p]=false;return false
                },
                ID:function(g){
                    return g[1].replace(/\\/g,"")
                },
                TAG:function(g){
                    return g[1].toLowerCase()
                },
                CHILD:function(g){
                    if(g[1]==="nth"){
                        var h=/(-?)(\d*)n((?:\+|-)?\d*)/.exec(g[2]==="even"&&"2n"||g[2]==="odd"&&"2n+1"||!/\D/.test(g[2])&&"0n+"+g[2]||g[2]);
                        g[2]=h[1]+(h[2]||1)-0;
                        g[3]=h[3]-0
                    }
                    g[0]=e++;
                    return g
                },
                ATTR:function(g,h,l,m,q,p){
                    h=g[1].replace(/\\/g,"");
                    if(!p&&n.attrMap[h])g[1]=n.attrMap[h];
                    if(g[2]==="~=")g[4]=" "+g[4]+" ";
                    return g
                },
                PSEUDO:function(g,h,l,m,q){
                    if(g[1]==="not")if((f.exec(g[3])||"").length>1||/^\w/.test(g[3]))g[3]=k(g[3],null,null,h);
                        else{
                            g=k.filter(g[3],h,l,true^q);
                            l||m.push.apply(m,
                                g);
                            return false
                        }else if(n.match.POS.test(g[0])||n.match.CHILD.test(g[0]))return true;
                    return g
                },
                POS:function(g){
                    g.unshift(true);
                    return g
                }
            },
            filters:{
                enabled:function(g){
                    return g.disabled===false&&g.type!=="hidden"
                },
                disabled:function(g){
                    return g.disabled===true
                },
                checked:function(g){
                    return g.checked===true
                },
                selected:function(g){
                    return g.selected===true
                },
                parent:function(g){
                    return!!g.firstChild
                },
                empty:function(g){
                    return!g.firstChild
                },
                has:function(g,h,l){
                    return!!k(l[3],g).length
                },
                header:function(g){
                    return/h\d/i.test(g.nodeName)
                },
                text:function(g){
                    return"text"===g.type
                },
                radio:function(g){
                    return"radio"===g.type
                },
                checkbox:function(g){
                    return"checkbox"===g.type
                },
                file:function(g){
                    return"file"===g.type
                },
                password:function(g){
                    return"password"===g.type
                },
                submit:function(g){
                    return"submit"===g.type
                },
                image:function(g){
                    return"image"===g.type
                },
                reset:function(g){
                    return"reset"===g.type
                },
                button:function(g){
                    return"button"===g.type||g.nodeName.toLowerCase()==="button"
                },
                input:function(g){
                    return/input|select|textarea|button/i.test(g.nodeName)
                }
            },
            setFilters:{
                first:function(g,h){
                    return h===0
                },
                last:function(g,h,l,m){
                    return h===m.length-1
                },
                even:function(g,h){
                    return h%2===0
                },
                odd:function(g,h){
                    return h%2===1
                },
                lt:function(g,h,l){
                    return h<l[3]-0
                },
                gt:function(g,h,l){
                    return h>l[3]-0
                },
                nth:function(g,h,l){
                    return l[3]-0===h
                },
                eq:function(g,h,l){
                    return l[3]-0===h
                }
            },
            filter:{
                PSEUDO:function(g,h,l,m){
                    var q=h[1],p=n.filters[q];
                    if(p)return p(g,l,h,m);
                    else if(q==="contains")return(g.textContent||g.innerText||a([g])||"").indexOf(h[3])>=0;
                    else if(q==="not"){
                        h=
                        h[3];
                        l=0;
                        for(m=h.length;l<m;l++)if(h[l]===g)return false;return true
                    }else k.error("Syntax error, unrecognized expression: "+q)
                },
                CHILD:function(g,h){
                    var l=h[1],m=g;
                    switch(l){
                        case "only":case "first":
                            for(;m=m.previousSibling;)if(m.nodeType===1)return false;if(l==="first")return true;
                            m=g;
                        case "last":
                            for(;m=m.nextSibling;)if(m.nodeType===1)return false;return true;
                        case "nth":
                            l=h[2];
                            var q=h[3];
                            if(l===1&&q===0)return true;
                            h=h[0];
                            var p=g.parentNode;
                            if(p&&(p.sizcache!==h||!g.nodeIndex)){
                                var v=0;
                                for(m=p.firstChild;m;m=
                                    m.nextSibling)if(m.nodeType===1)m.nodeIndex=++v;p.sizcache=h
                            }
                            g=g.nodeIndex-q;
                            return l===0?g===0:g%l===0&&g/l>=0
                    }
                },
                ID:function(g,h){
                    return g.nodeType===1&&g.getAttribute("id")===h
                },
                TAG:function(g,h){
                    return h==="*"&&g.nodeType===1||g.nodeName.toLowerCase()===h
                },
                CLASS:function(g,h){
                    return(" "+(g.className||g.getAttribute("class"))+" ").indexOf(h)>-1
                },
                ATTR:function(g,h){
                    var l=h[1];
                    g=n.attrHandle[l]?n.attrHandle[l](g):g[l]!=null?g[l]:g.getAttribute(l);
                    l=g+"";
                    var m=h[2];
                    h=h[4];
                    return g==null?m==="!=":m===
                    "="?l===h:m==="*="?l.indexOf(h)>=0:m==="~="?(" "+l+" ").indexOf(h)>=0:!h?l&&g!==false:m==="!="?l!==h:m==="^="?l.indexOf(h)===0:m==="$="?l.substr(l.length-h.length)===h:m==="|="?l===h||l.substr(0,h.length+1)===h+"-":false
                },
                POS:function(g,h,l,m){
                    var q=n.setFilters[h[2]];
                    if(q)return q(g,l,h,m)
                }
            }
        },r=n.match.POS;
        for(var u in n.match){
            n.match[u]=new RegExp(n.match[u].source+/(?![^\[]*\])(?![^\(]*\))/.source);
            n.leftMatch[u]=new RegExp(/(^(?:.|\r|\n)*?)/.source+n.match[u].source.replace(/\\(\d+)/g,function(g,
                h){
                return"\\"+(h-0+1)
            }))
        }
        var z=function(g,h){
            g=Array.prototype.slice.call(g,0);
            if(h){
                h.push.apply(h,g);
                return h
            }
            return g
        };
    
        try{
            Array.prototype.slice.call(s.documentElement.childNodes,0)
        }catch(C){
            z=function(g,h){
                h=h||[];
                if(j.call(g)==="[object Array]")Array.prototype.push.apply(h,g);
                else if(typeof g.length==="number")for(var l=0,m=g.length;l<m;l++)h.push(g[l]);else for(l=0;g[l];l++)h.push(g[l]);
                return h
            }
        }
        var B;
        if(s.documentElement.compareDocumentPosition)B=function(g,h){
            if(!g.compareDocumentPosition||
                !h.compareDocumentPosition){
                if(g==h)i=true;
                return g.compareDocumentPosition?-1:1
            }
            g=g.compareDocumentPosition(h)&4?-1:g===h?0:1;
            if(g===0)i=true;
            return g
        };
        else if("sourceIndex"in s.documentElement)B=function(g,h){
            if(!g.sourceIndex||!h.sourceIndex){
                if(g==h)i=true;
                return g.sourceIndex?-1:1
            }
            g=g.sourceIndex-h.sourceIndex;
            if(g===0)i=true;
            return g
        };
        else if(s.createRange)B=function(g,h){
            if(!g.ownerDocument||!h.ownerDocument){
                if(g==h)i=true;
                return g.ownerDocument?-1:1
            }
            var l=g.ownerDocument.createRange(),m=
            h.ownerDocument.createRange();
            l.setStart(g,0);
            l.setEnd(g,0);
            m.setStart(h,0);
            m.setEnd(h,0);
            g=l.compareBoundaryPoints(Range.START_TO_END,m);
            if(g===0)i=true;
            return g
        };
        (function(){
            var g=s.createElement("div"),h="script"+(new Date).getTime();
            g.innerHTML="<a name='"+h+"'/>";
            var l=s.documentElement;
            l.insertBefore(g,l.firstChild);
            if(s.getElementById(h)){
                n.find.ID=function(m,q,p){
                    if(typeof q.getElementById!=="undefined"&&!p)return(q=q.getElementById(m[1]))?q.id===m[1]||typeof q.getAttributeNode!=="undefined"&&
                        q.getAttributeNode("id").nodeValue===m[1]?[q]:w:[]
                };
                
                n.filter.ID=function(m,q){
                    var p=typeof m.getAttributeNode!=="undefined"&&m.getAttributeNode("id");
                    return m.nodeType===1&&p&&p.nodeValue===q
                }
            }
            l.removeChild(g);
            l=g=null
        })();
        (function(){
            var g=s.createElement("div");
            g.appendChild(s.createComment(""));
            if(g.getElementsByTagName("*").length>0)n.find.TAG=function(h,l){
                l=l.getElementsByTagName(h[1]);
                if(h[1]==="*"){
                    h=[];
                    for(var m=0;l[m];m++)l[m].nodeType===1&&h.push(l[m]);
                    l=h
                }
                return l
            };
        
            g.innerHTML="<a href='#'></a>";
            if(g.firstChild&&typeof g.firstChild.getAttribute!=="undefined"&&g.firstChild.getAttribute("href")!=="#")n.attrHandle.href=function(h){
                return h.getAttribute("href",2)
            };
        
            g=null
        })();
        s.querySelectorAll&&function(){
            var g=k,h=s.createElement("div");
            h.innerHTML="<p class='TEST'></p>";
            if(!(h.querySelectorAll&&h.querySelectorAll(".TEST").length===0)){
                k=function(m,q,p,v){
                    q=q||s;
                    if(!v&&q.nodeType===9&&!x(q))try{
                        return z(q.querySelectorAll(m),p)
                    }catch(t){}
                    return g(m,q,p,v)
                };
            
                for(var l in g)k[l]=g[l];h=null
            }
        }();
        (function(){
            var g=s.createElement("div");
            g.innerHTML="<div class='test e'></div><div class='test'></div>";
            if(!(!g.getElementsByClassName||g.getElementsByClassName("e").length===0)){
                g.lastChild.className="e";
                if(g.getElementsByClassName("e").length!==1){
                    n.order.splice(1,0,"CLASS");
                    n.find.CLASS=function(h,l,m){
                        if(typeof l.getElementsByClassName!=="undefined"&&!m)return l.getElementsByClassName(h[1])
                    };
                    
                    g=null
                }
            }
        })();
        var E=s.compareDocumentPosition?function(g,h){
            return!!(g.compareDocumentPosition(h)&16)
        }:
        function(g,h){
            return g!==h&&(g.contains?g.contains(h):true)
        },x=function(g){
            return(g=(g?g.ownerDocument||g:0).documentElement)?g.nodeName!=="HTML":false
        },ga=function(g,h){
            var l=[],m="",q;
            for(h=h.nodeType?[h]:h;q=n.match.PSEUDO.exec(g);){
                m+=q[0];
                g=g.replace(n.match.PSEUDO,"")
            }
            g=n.relative[g]?g+"*":g;
            q=0;
            for(var p=h.length;q<p;q++)k(g,h[q],l);
            return k.filter(m,l)
        };
    
        c.find=k;
        c.expr=k.selectors;
        c.expr[":"]=c.expr.filters;
        c.unique=k.uniqueSort;
        c.text=a;
        c.isXMLDoc=x;
        c.contains=E
    })();
    var eb=/Until$/,fb=/^(?:parents|prevUntil|prevAll)/,
    gb=/,/;
    R=Array.prototype.slice;
    var Ia=function(a,b,d){
        if(c.isFunction(b))return c.grep(a,function(e,j){
            return!!b.call(e,j,e)===d
        });
        else if(b.nodeType)return c.grep(a,function(e){
            return e===b===d
        });
        else if(typeof b==="string"){
            var f=c.grep(a,function(e){
                return e.nodeType===1
            });
            if(Ua.test(b))return c.filter(b,f,!d);else b=c.filter(b,f)
        }
        return c.grep(a,function(e){
            return c.inArray(e,b)>=0===d
        })
    };
    
    c.fn.extend({
        find:function(a){
            for(var b=this.pushStack("","find",a),d=0,f=0,e=this.length;f<e;f++){
                d=b.length;
                c.find(a,this[f],b);
                if(f>0)for(var j=d;j<b.length;j++)for(var i=0;i<d;i++)if(b[i]===b[j]){
                    b.splice(j--,1);
                    break
                }
            }
            return b
        },
        has:function(a){
            var b=c(a);
            return this.filter(function(){
                for(var d=0,f=b.length;d<f;d++)if(c.contains(this,b[d]))return true
            })
        },
        not:function(a){
            return this.pushStack(Ia(this,a,false),"not",a)
        },
        filter:function(a){
            return this.pushStack(Ia(this,a,true),"filter",a)
        },
        is:function(a){
            return!!a&&c.filter(a,this).length>0
        },
        closest:function(a,b){
            if(c.isArray(a)){
                var d=[],f=this[0],e,j=

                {},i;
                if(f&&a.length){
                    e=0;
                    for(var o=a.length;e<o;e++){
                        i=a[e];
                        j[i]||(j[i]=c.expr.match.POS.test(i)?c(i,b||this.context):i)
                    }
                    for(;f&&f.ownerDocument&&f!==b;){
                        for(i in j){
                            e=j[i];
                            if(e.jquery?e.index(f)>-1:c(f).is(e)){
                                d.push({
                                    selector:i,
                                    elem:f
                                });
                                delete j[i]
                            }
                        }
                        f=f.parentNode
                    }
                }
                return d
            }
            var k=c.expr.match.POS.test(a)?c(a,b||this.context):null;
            return this.map(function(n,r){
                for(;r&&r.ownerDocument&&r!==b;){
                    if(k?k.index(r)>-1:c(r).is(a))return r;
                    r=r.parentNode
                }
                return null
            })
        },
        index:function(a){
            if(!a||typeof a===
                "string")return c.inArray(this[0],a?c(a):this.parent().children());
            return c.inArray(a.jquery?a[0]:a,this)
        },
        add:function(a,b){
            a=typeof a==="string"?c(a,b||this.context):c.makeArray(a);
            b=c.merge(this.get(),a);
            return this.pushStack(qa(a[0])||qa(b[0])?b:c.unique(b))
        },
        andSelf:function(){
            return this.add(this.prevObject)
        }
    });
    c.each({
        parent:function(a){
            return(a=a.parentNode)&&a.nodeType!==11?a:null
        },
        parents:function(a){
            return c.dir(a,"parentNode")
        },
        parentsUntil:function(a,b,d){
            return c.dir(a,"parentNode",
                d)
        },
        next:function(a){
            return c.nth(a,2,"nextSibling")
        },
        prev:function(a){
            return c.nth(a,2,"previousSibling")
        },
        nextAll:function(a){
            return c.dir(a,"nextSibling")
        },
        prevAll:function(a){
            return c.dir(a,"previousSibling")
        },
        nextUntil:function(a,b,d){
            return c.dir(a,"nextSibling",d)
        },
        prevUntil:function(a,b,d){
            return c.dir(a,"previousSibling",d)
        },
        siblings:function(a){
            return c.sibling(a.parentNode.firstChild,a)
        },
        children:function(a){
            return c.sibling(a.firstChild)
        },
        contents:function(a){
            return c.nodeName(a,"iframe")?
            a.contentDocument||a.contentWindow.document:c.makeArray(a.childNodes)
        }
    },function(a,b){
        c.fn[a]=function(d,f){
            var e=c.map(this,b,d);
            eb.test(a)||(f=d);
            if(f&&typeof f==="string")e=c.filter(f,e);
            e=this.length>1?c.unique(e):e;
            if((this.length>1||gb.test(f))&&fb.test(a))e=e.reverse();
            return this.pushStack(e,a,R.call(arguments).join(","))
        }
    });
    c.extend({
        filter:function(a,b,d){
            if(d)a=":not("+a+")";
            return c.find.matches(a,b)
        },
        dir:function(a,b,d){
            var f=[];
            for(a=a[b];a&&a.nodeType!==9&&(d===w||a.nodeType!==1||!c(a).is(d));){
                a.nodeType===
                1&&f.push(a);
                a=a[b]
            }
            return f
        },
        nth:function(a,b,d){
            b=b||1;
            for(var f=0;a;a=a[d])if(a.nodeType===1&&++f===b)break;return a
        },
        sibling:function(a,b){
            for(var d=[];a;a=a.nextSibling)a.nodeType===1&&a!==b&&d.push(a);
            return d
        }
    });
    var Ja=/ jQuery\d+="(?:\d+|null)"/g,V=/^\s+/,Ka=/(<([\w:]+)[^>]*?)\/>/g,hb=/^(?:area|br|col|embed|hr|img|input|link|meta|param)$/i,La=/<([\w:]+)/,ib=/<tbody/i,jb=/<|&#?\w+;/,ta=/<script|<object|<embed|<option|<style/i,ua=/checked\s*(?:[^=]|=\s*.checked.)/i,Ma=function(a,b,d){
        return hb.test(d)?
        a:b+"></"+d+">"
    },F={
        option:[1,"<select multiple='multiple'>","</select>"],
        legend:[1,"<fieldset>","</fieldset>"],
        thead:[1,"<table>","</table>"],
        tr:[2,"<table><tbody>","</tbody></table>"],
        td:[3,"<table><tbody><tr>","</tr></tbody></table>"],
        col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],
        area:[1,"<map>","</map>"],
        _default:[0,"",""]
    };
    
    F.optgroup=F.option;
    F.tbody=F.tfoot=F.colgroup=F.caption=F.thead;
    F.th=F.td;
    if(!c.support.htmlSerialize)F._default=[1,"div<div>","</div>"];
    c.fn.extend({
        text:function(a){
            if(c.isFunction(a))return this.each(function(b){
                var d=
                c(this);
                d.text(a.call(this,b,d.text()))
            });
            if(typeof a!=="object"&&a!==w)return this.empty().append((this[0]&&this[0].ownerDocument||s).createTextNode(a));
            return c.text(this)
        },
        wrapAll:function(a){
            if(c.isFunction(a))return this.each(function(d){
                c(this).wrapAll(a.call(this,d))
            });
            if(this[0]){
                var b=c(a,this[0].ownerDocument).eq(0).clone(true);
                this[0].parentNode&&b.insertBefore(this[0]);
                b.map(function(){
                    for(var d=this;d.firstChild&&d.firstChild.nodeType===1;)d=d.firstChild;
                    return d
                }).append(this)
            }
            return this
        },
        wrapInner:function(a){
            if(c.isFunction(a))return this.each(function(b){
                c(this).wrapInner(a.call(this,b))
            });
            return this.each(function(){
                var b=c(this),d=b.contents();
                d.length?d.wrapAll(a):b.append(a)
            })
        },
        wrap:function(a){
            return this.each(function(){
                c(this).wrapAll(a)
            })
        },
        unwrap:function(){
            return this.parent().each(function(){
                c.nodeName(this,"body")||c(this).replaceWith(this.childNodes)
            }).end()
        },
        append:function(){
            return this.domManip(arguments,true,function(a){
                this.nodeType===1&&this.appendChild(a)
            })
        },
        prepend:function(){
            return this.domManip(arguments,true,function(a){
                this.nodeType===1&&this.insertBefore(a,this.firstChild)
            })
        },
        before:function(){
            if(this[0]&&this[0].parentNode)return this.domManip(arguments,false,function(b){
                this.parentNode.insertBefore(b,this)
            });
            else if(arguments.length){
                var a=c(arguments[0]);
                a.push.apply(a,this.toArray());
                return this.pushStack(a,"before",arguments)
            }
        },
        after:function(){
            if(this[0]&&this[0].parentNode)return this.domManip(arguments,false,function(b){
                this.parentNode.insertBefore(b,
                    this.nextSibling)
            });
            else if(arguments.length){
                var a=this.pushStack(this,"after",arguments);
                a.push.apply(a,c(arguments[0]).toArray());
                return a
            }
        },
        remove:function(a,b){
            for(var d=0,f;(f=this[d])!=null;d++)if(!a||c.filter(a,[f]).length){
                if(!b&&f.nodeType===1){
                    c.cleanData(f.getElementsByTagName("*"));
                    c.cleanData([f])
                }
                f.parentNode&&f.parentNode.removeChild(f)
            }
            return this
        },
        empty:function(){
            for(var a=0,b;(b=this[a])!=null;a++)for(b.nodeType===1&&c.cleanData(b.getElementsByTagName("*"));b.firstChild;)b.removeChild(b.firstChild);
            return this
        },
        clone:function(a){
            var b=this.map(function(){
                if(!c.support.noCloneEvent&&!c.isXMLDoc(this)){
                    var d=this.outerHTML,f=this.ownerDocument;
                    if(!d){
                        d=f.createElement("div");
                        d.appendChild(this.cloneNode(true));
                        d=d.innerHTML
                    }
                    return c.clean([d.replace(Ja,"").replace(/=([^="'>\s]+\/)>/g,'="$1">').replace(V,"")],f)[0]
                }else return this.cloneNode(true)
            });
            if(a===true){
                ra(this,b);
                ra(this.find("*"),b.find("*"))
            }
            return b
        },
        html:function(a){
            if(a===w)return this[0]&&this[0].nodeType===1?this[0].innerHTML.replace(Ja,
                ""):null;
            else if(typeof a==="string"&&!ta.test(a)&&(c.support.leadingWhitespace||!V.test(a))&&!F[(La.exec(a)||["",""])[1].toLowerCase()]){
                a=a.replace(Ka,Ma);
                try{
                    for(var b=0,d=this.length;b<d;b++)if(this[b].nodeType===1){
                        c.cleanData(this[b].getElementsByTagName("*"));
                        this[b].innerHTML=a
                    }
                }catch(f){
                    this.empty().append(a)
                }
            }else c.isFunction(a)?this.each(function(e){
                var j=c(this),i=j.html();
                j.empty().append(function(){
                    return a.call(this,e,i)
                })
            }):this.empty().append(a);
            return this
        },
        replaceWith:function(a){
            if(this[0]&&
                this[0].parentNode){
                if(c.isFunction(a))return this.each(function(b){
                    var d=c(this),f=d.html();
                    d.replaceWith(a.call(this,b,f))
                });
                if(typeof a!=="string")a=c(a).detach();
                return this.each(function(){
                    var b=this.nextSibling,d=this.parentNode;
                    c(this).remove();
                    b?c(b).before(a):c(d).append(a)
                })
            }else return this.pushStack(c(c.isFunction(a)?a():a),"replaceWith",a)
        },
        detach:function(a){
            return this.remove(a,true)
        },
        domManip:function(a,b,d){
            function f(u){
                return c.nodeName(u,"table")?u.getElementsByTagName("tbody")[0]||
                u.appendChild(u.ownerDocument.createElement("tbody")):u
            }
            var e,j,i=a[0],o=[],k;
            if(!c.support.checkClone&&arguments.length===3&&typeof i==="string"&&ua.test(i))return this.each(function(){
                c(this).domManip(a,b,d,true)
            });
            if(c.isFunction(i))return this.each(function(u){
                var z=c(this);
                a[0]=i.call(this,u,b?z.html():w);
                z.domManip(a,b,d)
            });
            if(this[0]){
                e=i&&i.parentNode;
                e=c.support.parentNode&&e&&e.nodeType===11&&e.childNodes.length===this.length?{
                    fragment:e
                }:sa(a,this,o);
                k=e.fragment;
                if(j=k.childNodes.length===
                    1?(k=k.firstChild):k.firstChild){
                    b=b&&c.nodeName(j,"tr");
                    for(var n=0,r=this.length;n<r;n++)d.call(b?f(this[n],j):this[n],n>0||e.cacheable||this.length>1?k.cloneNode(true):k)
                }
                o.length&&c.each(o,Qa)
            }
            return this
        }
    });
    c.fragments={};

    c.each({
        appendTo:"append",
        prependTo:"prepend",
        insertBefore:"before",
        insertAfter:"after",
        replaceAll:"replaceWith"
    },function(a,b){
        c.fn[a]=function(d){
            var f=[];
            d=c(d);
            var e=this.length===1&&this[0].parentNode;
            if(e&&e.nodeType===11&&e.childNodes.length===1&&d.length===1){
                d[b](this[0]);
                return this
            }else{
                e=0;
                for(var j=d.length;e<j;e++){
                    var i=(e>0?this.clone(true):this).get();
                    c.fn[b].apply(c(d[e]),i);
                    f=f.concat(i)
                }
                return this.pushStack(f,a,d.selector)
            }
        }
    });
    c.extend({
        clean:function(a,b,d,f){
            b=b||s;
            if(typeof b.createElement==="undefined")b=b.ownerDocument||b[0]&&b[0].ownerDocument||s;
            for(var e=[],j=0,i;(i=a[j])!=null;j++){
                if(typeof i==="number")i+="";
                if(i){
                    if(typeof i==="string"&&!jb.test(i))i=b.createTextNode(i);
                    else if(typeof i==="string"){
                        i=i.replace(Ka,Ma);
                        var o=(La.exec(i)||["",
                            ""])[1].toLowerCase(),k=F[o]||F._default,n=k[0],r=b.createElement("div");
                        for(r.innerHTML=k[1]+i+k[2];n--;)r=r.lastChild;
                        if(!c.support.tbody){
                            n=ib.test(i);
                            o=o==="table"&&!n?r.firstChild&&r.firstChild.childNodes:k[1]==="<table>"&&!n?r.childNodes:[];
                            for(k=o.length-1;k>=0;--k)c.nodeName(o[k],"tbody")&&!o[k].childNodes.length&&o[k].parentNode.removeChild(o[k])
                        }!c.support.leadingWhitespace&&V.test(i)&&r.insertBefore(b.createTextNode(V.exec(i)[0]),r.firstChild);
                        i=r.childNodes
                    }
                    if(i.nodeType)e.push(i);else e=
                        c.merge(e,i)
                }
            }
            if(d)for(j=0;e[j];j++)if(f&&c.nodeName(e[j],"script")&&(!e[j].type||e[j].type.toLowerCase()==="text/javascript"))f.push(e[j].parentNode?e[j].parentNode.removeChild(e[j]):e[j]);
                else{
                    e[j].nodeType===1&&e.splice.apply(e,[j+1,0].concat(c.makeArray(e[j].getElementsByTagName("script"))));
                    d.appendChild(e[j])
                }
            return e
        },
        cleanData:function(a){
            for(var b,d,f=c.cache,e=c.event.special,j=c.support.deleteExpando,i=0,o;(o=a[i])!=null;i++)if(d=o[c.expando]){
                b=f[d];
                if(b.events)for(var k in b.events)e[k]?
                    c.event.remove(o,k):Ca(o,k,b.handle);if(j)delete o[c.expando];else o.removeAttribute&&o.removeAttribute(c.expando);
                delete f[d]
            }
        }
    });
    var kb=/z-?index|font-?weight|opacity|zoom|line-?height/i,Na=/alpha\([^)]*\)/,Oa=/opacity=([^)]*)/,ha=/float/i,ia=/-([a-z])/ig,lb=/([A-Z])/g,mb=/^-?\d+(?:px)?$/i,nb=/^-?\d/,ob={
        position:"absolute",
        visibility:"hidden",
        display:"block"
    },pb=["Left","Right"],qb=["Top","Bottom"],rb=s.defaultView&&s.defaultView.getComputedStyle,Pa=c.support.cssFloat?"cssFloat":"styleFloat",ja=
    function(a,b){
        return b.toUpperCase()
    };
    
    c.fn.css=function(a,b){
        return X(this,a,b,true,function(d,f,e){
            if(e===w)return c.curCSS(d,f);
            if(typeof e==="number"&&!kb.test(f))e+="px";
            c.style(d,f,e)
        })
    };
    
    c.extend({
        style:function(a,b,d){
            if(!a||a.nodeType===3||a.nodeType===8)return w;
            if((b==="width"||b==="height")&&parseFloat(d)<0)d=w;
            var f=a.style||a,e=d!==w;
            if(!c.support.opacity&&b==="opacity"){
                if(e){
                    f.zoom=1;
                    b=parseInt(d,10)+""==="NaN"?"":"alpha(opacity="+d*100+")";
                    a=f.filter||c.curCSS(a,"filter")||"";
                    f.filter=
                    Na.test(a)?a.replace(Na,b):b
                }
                return f.filter&&f.filter.indexOf("opacity=")>=0?parseFloat(Oa.exec(f.filter)[1])/100+"":""
            }
            if(ha.test(b))b=Pa;
            b=b.replace(ia,ja);
            if(e)f[b]=d;
            return f[b]
        },
        css:function(a,b,d,f){
            if(b==="width"||b==="height"){
                var e,j=b==="width"?pb:qb;
                function i(){
                    e=b==="width"?a.offsetWidth:a.offsetHeight;
                    f!=="border"&&c.each(j,function(){
                        f||(e-=parseFloat(c.curCSS(a,"padding"+this,true))||0);
                        if(f==="margin")e+=parseFloat(c.curCSS(a,"margin"+this,true))||0;else e-=parseFloat(c.curCSS(a,
                            "border"+this+"Width",true))||0
                    })
                }
                a.offsetWidth!==0?i():c.swap(a,ob,i);
                return Math.max(0,Math.round(e))
            }
            return c.curCSS(a,b,d)
        },
        curCSS:function(a,b,d){
            var f,e=a.style;
            if(!c.support.opacity&&b==="opacity"&&a.currentStyle){
                f=Oa.test(a.currentStyle.filter||"")?parseFloat(RegExp.$1)/100+"":"";
                return f===""?"1":f
            }
            if(ha.test(b))b=Pa;
            if(!d&&e&&e[b])f=e[b];
            else if(rb){
                if(ha.test(b))b="float";
                b=b.replace(lb,"-$1").toLowerCase();
                e=a.ownerDocument.defaultView;
                if(!e)return null;
                if(a=e.getComputedStyle(a,null))f=
                    a.getPropertyValue(b);
                if(b==="opacity"&&f==="")f="1"
            }else if(a.currentStyle){
                d=b.replace(ia,ja);
                f=a.currentStyle[b]||a.currentStyle[d];
                if(!mb.test(f)&&nb.test(f)){
                    b=e.left;
                    var j=a.runtimeStyle.left;
                    a.runtimeStyle.left=a.currentStyle.left;
                    e.left=d==="fontSize"?"1em":f||0;
                    f=e.pixelLeft+"px";
                    e.left=b;
                    a.runtimeStyle.left=j
                }
            }
            return f
        },
        swap:function(a,b,d){
            var f={};
    
            for(var e in b){
                f[e]=a.style[e];
                a.style[e]=b[e]
            }
            d.call(a);
            for(e in b)a.style[e]=f[e]
        }
    });
    if(c.expr&&c.expr.filters){
        c.expr.filters.hidden=function(a){
            var b=
            a.offsetWidth,d=a.offsetHeight,f=a.nodeName.toLowerCase()==="tr";
            return b===0&&d===0&&!f?true:b>0&&d>0&&!f?false:c.curCSS(a,"display")==="none"
        };
        
        c.expr.filters.visible=function(a){
            return!c.expr.filters.hidden(a)
        }
    }
    var sb=J(),tb=/<script(.|\s)*?\/script>/gi,ub=/select|textarea/i,vb=/color|date|datetime|email|hidden|month|number|password|range|search|tel|text|time|url|week/i,N=/=\?(&|$)/,ka=/\?/,wb=/(\?|&)_=.*?(&|$)/,xb=/^(\w+:)?\/\/([^\/?#]+)/,yb=/%20/g,zb=c.fn.load;
    c.fn.extend({
        load:function(a,b,d){
            if(typeof a!==
                "string")return zb.call(this,a);
            else if(!this.length)return this;
            var f=a.indexOf(" ");
            if(f>=0){
                var e=a.slice(f,a.length);
                a=a.slice(0,f)
            }
            f="GET";
            if(b)if(c.isFunction(b)){
                d=b;
                b=null
            }else if(typeof b==="object"){
                b=c.param(b,c.ajaxSettings.traditional);
                f="POST"
            }
            var j=this;
            c.ajax({
                url:a,
                type:f,
                dataType:"html",
                data:b,
                complete:function(i,o){
                    if(o==="success"||o==="notmodified")j.html(e?c("<div />").append(i.responseText.replace(tb,"")).find(e):i.responseText);
                    d&&j.each(d,[i.responseText,o,i])
                }
            });
            return this
        },
        serialize:function(){
            return c.param(this.serializeArray())
        },
        serializeArray:function(){
            return this.map(function(){
                return this.elements?c.makeArray(this.elements):this
            }).filter(function(){
                return this.name&&!this.disabled&&(this.checked||ub.test(this.nodeName)||vb.test(this.type))
            }).map(function(a,b){
                a=c(this).val();
                return a==null?null:c.isArray(a)?c.map(a,function(d){
                    return{
                        name:b.name,
                        value:d
                    }
                }):{
                    name:b.name,
                    value:a
                }
            }).get()
        }
    });
    c.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),
        function(a,b){
            c.fn[b]=function(d){
                return this.bind(b,d)
            }
        });
    c.extend({
        get:function(a,b,d,f){
            if(c.isFunction(b)){
                f=f||d;
                d=b;
                b=null
            }
            return c.ajax({
                type:"GET",
                url:a,
                data:b,
                success:d,
                dataType:f
            })
        },
        getScript:function(a,b){
            return c.get(a,null,b,"script")
        },
        getJSON:function(a,b,d){
            return c.get(a,b,d,"json")
        },
        post:function(a,b,d,f){
            if(c.isFunction(b)){
                f=f||d;
                d=b;
                b={}
            }
            return c.ajax({
                type:"POST",
                url:a,
                data:b,
                success:d,
                dataType:f
            })
        },
        ajaxSetup:function(a){
            c.extend(c.ajaxSettings,a)
        },
        ajaxSettings:{
            url:location.href,
            global:true,
            type:"GET",
            contentType:"application/x-www-form-urlencoded",
            processData:true,
            async:true,
            xhr:A.XMLHttpRequest&&(A.location.protocol!=="file:"||!A.ActiveXObject)?function(){
                return new A.XMLHttpRequest
            }:function(){
                try{
                    return new A.ActiveXObject("Microsoft.XMLHTTP")
                }catch(a){}
            },
            accepts:{
                xml:"application/xml, text/xml",
                html:"text/html",
                script:"text/javascript, application/javascript",
                json:"application/json, text/javascript",
                text:"text/plain",
                _default:"*/*"
            }
        },
        lastModified:{},
        etag:{},
        ajax:function(a){
            function b(){
                e.success&&
                e.success.call(k,o,i,x);
                e.global&&f("ajaxSuccess",[x,e])
            }
            function d(){
                e.complete&&e.complete.call(k,x,i);
                e.global&&f("ajaxComplete",[x,e]);
                e.global&&!--c.active&&c.event.trigger("ajaxStop")
            }
            function f(q,p){
                (e.context?c(e.context):c.event).trigger(q,p)
            }
            var e=c.extend(true,{},c.ajaxSettings,a),j,i,o,k=a&&a.context||e,n=e.type.toUpperCase();
            if(e.data&&e.processData&&typeof e.data!=="string")e.data=c.param(e.data,e.traditional);
            if(e.dataType==="jsonp"){
                if(n==="GET")N.test(e.url)||(e.url+=(ka.test(e.url)?
                    "&":"?")+(e.jsonp||"callback")+"=?");
                else if(!e.data||!N.test(e.data))e.data=(e.data?e.data+"&":"")+(e.jsonp||"callback")+"=?";
                e.dataType="json"
            }
            if(e.dataType==="json"&&(e.data&&N.test(e.data)||N.test(e.url))){
                j=e.jsonpCallback||"jsonp"+sb++;
                if(e.data)e.data=(e.data+"").replace(N,"="+j+"$1");
                e.url=e.url.replace(N,"="+j+"$1");
                e.dataType="script";
                A[j]=A[j]||function(q){
                    o=q;
                    b();
                    d();
                    A[j]=w;
                    try{
                        delete A[j]
                    }catch(p){}
                    z&&z.removeChild(C)
                }
            }
            if(e.dataType==="script"&&e.cache===null)e.cache=false;
            if(e.cache===
                false&&n==="GET"){
                var r=J(),u=e.url.replace(wb,"$1_="+r+"$2");
                e.url=u+(u===e.url?(ka.test(e.url)?"&":"?")+"_="+r:"")
            }
            if(e.data&&n==="GET")e.url+=(ka.test(e.url)?"&":"?")+e.data;
            e.global&&!c.active++&&c.event.trigger("ajaxStart");
            r=(r=xb.exec(e.url))&&(r[1]&&r[1]!==location.protocol||r[2]!==location.host);
            if(e.dataType==="script"&&n==="GET"&&r){
                var z=s.getElementsByTagName("head")[0]||s.documentElement,C=s.createElement("script");
                C.src=e.url;
                if(e.scriptCharset)C.charset=e.scriptCharset;
                if(!j){
                    var B=
                    false;
                    C.onload=C.onreadystatechange=function(){
                        if(!B&&(!this.readyState||this.readyState==="loaded"||this.readyState==="complete")){
                            B=true;
                            b();
                            d();
                            C.onload=C.onreadystatechange=null;
                            z&&C.parentNode&&z.removeChild(C)
                        }
                    }
                }
                z.insertBefore(C,z.firstChild);
                return w
            }
            var E=false,x=e.xhr();
            if(x){
                e.username?x.open(n,e.url,e.async,e.username,e.password):x.open(n,e.url,e.async);
                try{
                    if(e.data||a&&a.contentType)x.setRequestHeader("Content-Type",e.contentType);
                    if(e.ifModified){
                        c.lastModified[e.url]&&x.setRequestHeader("If-Modified-Since",
                            c.lastModified[e.url]);
                        c.etag[e.url]&&x.setRequestHeader("If-None-Match",c.etag[e.url])
                    }
                    r||x.setRequestHeader("X-Requested-With","XMLHttpRequest");
                    x.setRequestHeader("Accept",e.dataType&&e.accepts[e.dataType]?e.accepts[e.dataType]+", */*":e.accepts._default)
                }catch(ga){}
                if(e.beforeSend&&e.beforeSend.call(k,x,e)===false){
                    e.global&&!--c.active&&c.event.trigger("ajaxStop");
                    x.abort();
                    return false
                }
                e.global&&f("ajaxSend",[x,e]);
                var g=x.onreadystatechange=function(q){
                    if(!x||x.readyState===0||q==="abort"){
                        E||
                        d();
                        E=true;
                        if(x)x.onreadystatechange=c.noop
                    }else if(!E&&x&&(x.readyState===4||q==="timeout")){
                        E=true;
                        x.onreadystatechange=c.noop;
                        i=q==="timeout"?"timeout":!c.httpSuccess(x)?"error":e.ifModified&&c.httpNotModified(x,e.url)?"notmodified":"success";
                        var p;
                        if(i==="success")try{
                            o=c.httpData(x,e.dataType,e)
                        }catch(v){
                            i="parsererror";
                            p=v
                        }
                        if(i==="success"||i==="notmodified")j||b();else c.handleError(e,x,i,p);
                        d();
                        q==="timeout"&&x.abort();
                        if(e.async)x=null
                    }
                };
    
                try{
                    var h=x.abort;
                    x.abort=function(){
                        x&&h.call(x);
                        g("abort")
                    }
                }catch(l){}
                e.async&&e.timeout>0&&setTimeout(function(){
                    x&&!E&&g("timeout")
                },e.timeout);
                try{
                    x.send(n==="POST"||n==="PUT"||n==="DELETE"?e.data:null)
                }catch(m){
                    c.handleError(e,x,null,m);
                    d()
                }
                e.async||g();
                return x
            }
        },
        handleError:function(a,b,d,f){
            if(a.error)a.error.call(a.context||a,b,d,f);
            if(a.global)(a.context?c(a.context):c.event).trigger("ajaxError",[b,a,f])
        },
        active:0,
        httpSuccess:function(a){
            try{
                return!a.status&&location.protocol==="file:"||a.status>=200&&a.status<300||a.status===304||a.status===
                1223||a.status===0
            }catch(b){}
            return false
        },
        httpNotModified:function(a,b){
            var d=a.getResponseHeader("Last-Modified"),f=a.getResponseHeader("Etag");
            if(d)c.lastModified[b]=d;
            if(f)c.etag[b]=f;
            return a.status===304||a.status===0
        },
        httpData:function(a,b,d){
            var f=a.getResponseHeader("content-type")||"",e=b==="xml"||!b&&f.indexOf("xml")>=0;
            a=e?a.responseXML:a.responseText;
            e&&a.documentElement.nodeName==="parsererror"&&c.error("parsererror");
            if(d&&d.dataFilter)a=d.dataFilter(a,b);
            if(typeof a==="string")if(b===
                "json"||!b&&f.indexOf("json")>=0)a=c.parseJSON(a);
                else if(b==="script"||!b&&f.indexOf("javascript")>=0)c.globalEval(a);
            return a
        },
        param:function(a,b){
            function d(i,o){
                if(c.isArray(o))c.each(o,function(k,n){
                    b||/\[\]$/.test(i)?f(i,n):d(i+"["+(typeof n==="object"||c.isArray(n)?k:"")+"]",n)
                });else!b&&o!=null&&typeof o==="object"?c.each(o,function(k,n){
                    d(i+"["+k+"]",n)
                }):f(i,o)
            }
            function f(i,o){
                o=c.isFunction(o)?o():o;
                e[e.length]=encodeURIComponent(i)+"="+encodeURIComponent(o)
            }
            var e=[];
            if(b===w)b=c.ajaxSettings.traditional;
            if(c.isArray(a)||a.jquery)c.each(a,function(){
                f(this.name,this.value)
            });else for(var j in a)d(j,a[j]);return e.join("&").replace(yb,"+")
        }
    });
    var la={},Ab=/toggle|show|hide/,Bb=/^([+-]=)?([\d+-.]+)(.*)$/,W,va=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]];
    c.fn.extend({
        show:function(a,b){
            if(a||a===0)return this.animate(K("show",3),a,b);
            else{
                a=0;
                for(b=this.length;a<b;a++){
                    var d=c.data(this[a],"olddisplay");
                    this[a].style.display=d||"";
                    if(c.css(this[a],"display")==="none"){
                        d=this[a].nodeName;
                        var f;
                        if(la[d])f=la[d];
                        else{
                            var e=c("<"+d+" />").appendTo("body");
                            f=e.css("display");
                            if(f==="none")f="block";
                            e.remove();
                            la[d]=f
                        }
                        c.data(this[a],"olddisplay",f)
                    }
                }
                a=0;
                for(b=this.length;a<b;a++)this[a].style.display=c.data(this[a],"olddisplay")||"";
                return this
            }
        },
        hide:function(a,b){
            if(a||a===0)return this.animate(K("hide",3),a,b);
            else{
                a=0;
                for(b=this.length;a<b;a++){
                    var d=c.data(this[a],"olddisplay");
                    !d&&d!=="none"&&c.data(this[a],
                        "olddisplay",c.css(this[a],"display"))
                }
                a=0;
                for(b=this.length;a<b;a++)this[a].style.display="none";
                return this
            }
        },
        _toggle:c.fn.toggle,
        toggle:function(a,b){
            var d=typeof a==="boolean";
            if(c.isFunction(a)&&c.isFunction(b))this._toggle.apply(this,arguments);else a==null||d?this.each(function(){
                var f=d?a:c(this).is(":hidden");
                c(this)[f?"show":"hide"]()
            }):this.animate(K("toggle",3),a,b);
            return this
        },
        fadeTo:function(a,b,d){
            return this.filter(":hidden").css("opacity",0).show().end().animate({
                opacity:b
            },a,d)
        },
        animate:function(a,b,d,f){
            var e=c.speed(b,d,f);
            if(c.isEmptyObject(a))return this.each(e.complete);
            return this[e.queue===false?"each":"queue"](function(){
                var j=c.extend({},e),i,o=this.nodeType===1&&c(this).is(":hidden"),k=this;
                for(i in a){
                    var n=i.replace(ia,ja);
                    if(i!==n){
                        a[n]=a[i];
                        delete a[i];
                        i=n
                    }
                    if(a[i]==="hide"&&o||a[i]==="show"&&!o)return j.complete.call(this);
                    if((i==="height"||i==="width")&&this.style){
                        j.display=c.css(this,"display");
                        j.overflow=this.style.overflow
                    }
                    if(c.isArray(a[i])){
                        (j.specialEasing=
                            j.specialEasing||{})[i]=a[i][1];
                        a[i]=a[i][0]
                    }
                }
                if(j.overflow!=null)this.style.overflow="hidden";
                j.curAnim=c.extend({},a);
                c.each(a,function(r,u){
                    var z=new c.fx(k,j,r);
                    if(Ab.test(u))z[u==="toggle"?o?"show":"hide":u](a);
                    else{
                        var C=Bb.exec(u),B=z.cur(true)||0;
                        if(C){
                            u=parseFloat(C[2]);
                            var E=C[3]||"px";
                            if(E!=="px"){
                                k.style[r]=(u||1)+E;
                                B=(u||1)/z.cur(true)*B;
                                k.style[r]=B+E
                            }
                            if(C[1])u=(C[1]==="-="?-1:1)*u+B;
                            z.custom(B,u,E)
                        }else z.custom(B,u,"")
                    }
                });
                return true
            })
        },
        stop:function(a,b){
            var d=c.timers;
            a&&this.queue([]);
            this.each(function(){
                for(var f=d.length-1;f>=0;f--)if(d[f].elem===this){
                    b&&d[f](true);
                    d.splice(f,1)
                }
            });
            b||this.dequeue();
            return this
        }
    });
    c.each({
        slideDown:K("show",1),
        slideUp:K("hide",1),
        slideToggle:K("toggle",1),
        fadeIn:{
            opacity:"show"
        },
        fadeOut:{
            opacity:"hide"
        }
    },function(a,b){
        c.fn[a]=function(d,f){
            return this.animate(b,d,f)
        }
    });
    c.extend({
        speed:function(a,b,d){
            var f=a&&typeof a==="object"?a:{
                complete:d||!d&&b||c.isFunction(a)&&a,
                duration:a,
                easing:d&&b||b&&!c.isFunction(b)&&b
            };
            
            f.duration=c.fx.off?0:typeof f.duration===
            "number"?f.duration:c.fx.speeds[f.duration]||c.fx.speeds._default;
            f.old=f.complete;
            f.complete=function(){
                f.queue!==false&&c(this).dequeue();
                c.isFunction(f.old)&&f.old.call(this)
            };
            
            return f
        },
        easing:{
            linear:function(a,b,d,f){
                return d+f*a
            },
            swing:function(a,b,d,f){
                return(-Math.cos(a*Math.PI)/2+0.5)*f+d
            }
        },
        timers:[],
        fx:function(a,b,d){
            this.options=b;
            this.elem=a;
            this.prop=d;
            if(!b.orig)b.orig={}
        }
    });
    c.fx.prototype={
        update:function(){
            this.options.step&&this.options.step.call(this.elem,this.now,this);
            (c.fx.step[this.prop]||
                c.fx.step._default)(this);
            if((this.prop==="height"||this.prop==="width")&&this.elem.style)this.elem.style.display="block"
        },
        cur:function(a){
            if(this.elem[this.prop]!=null&&(!this.elem.style||this.elem.style[this.prop]==null))return this.elem[this.prop];
            return(a=parseFloat(c.css(this.elem,this.prop,a)))&&a>-10000?a:parseFloat(c.curCSS(this.elem,this.prop))||0
        },
        custom:function(a,b,d){
            function f(j){
                return e.step(j)
            }
            this.startTime=J();
            this.start=a;
            this.end=b;
            this.unit=d||this.unit||"px";
            this.now=this.start;
            this.pos=this.state=0;
            var e=this;
            f.elem=this.elem;
            if(f()&&c.timers.push(f)&&!W)W=setInterval(c.fx.tick,13)
        },
        show:function(){
            this.options.orig[this.prop]=c.style(this.elem,this.prop);
            this.options.show=true;
            this.custom(this.prop==="width"||this.prop==="height"?1:0,this.cur());
            c(this.elem).show()
        },
        hide:function(){
            this.options.orig[this.prop]=c.style(this.elem,this.prop);
            this.options.hide=true;
            this.custom(this.cur(),0)
        },
        step:function(a){
            var b=J(),d=true;
            if(a||b>=this.options.duration+this.startTime){
                this.now=
                this.end;
                this.pos=this.state=1;
                this.update();
                this.options.curAnim[this.prop]=true;
                for(var f in this.options.curAnim)if(this.options.curAnim[f]!==true)d=false;if(d){
                    if(this.options.display!=null){
                        this.elem.style.overflow=this.options.overflow;
                        a=c.data(this.elem,"olddisplay");
                        this.elem.style.display=a?a:this.options.display;
                        if(c.css(this.elem,"display")==="none")this.elem.style.display="block"
                    }
                    this.options.hide&&c(this.elem).hide();
                    if(this.options.hide||this.options.show)for(var e in this.options.curAnim)c.style(this.elem,
                        e,this.options.orig[e]);this.options.complete.call(this.elem)
                }
                return false
            }else{
                e=b-this.startTime;
                this.state=e/this.options.duration;
                a=this.options.easing||(c.easing.swing?"swing":"linear");
                this.pos=c.easing[this.options.specialEasing&&this.options.specialEasing[this.prop]||a](this.state,e,0,1,this.options.duration);
                this.now=this.start+(this.end-this.start)*this.pos;
                this.update()
            }
            return true
        }
    };

    c.extend(c.fx,{
        tick:function(){
            for(var a=c.timers,b=0;b<a.length;b++)a[b]()||a.splice(b--,1);
            a.length||
            c.fx.stop()
        },
        stop:function(){
            clearInterval(W);
            W=null
        },
        speeds:{
            slow:600,
            fast:200,
            _default:400
        },
        step:{
            opacity:function(a){
                c.style(a.elem,"opacity",a.now)
            },
            _default:function(a){
                if(a.elem.style&&a.elem.style[a.prop]!=null)a.elem.style[a.prop]=(a.prop==="width"||a.prop==="height"?Math.max(0,a.now):a.now)+a.unit;else a.elem[a.prop]=a.now
            }
        }
    });
    if(c.expr&&c.expr.filters)c.expr.filters.animated=function(a){
        return c.grep(c.timers,function(b){
            return a===b.elem
        }).length
    };
    
    c.fn.offset="getBoundingClientRect"in s.documentElement?
    function(a){
        var b=this[0];
        if(a)return this.each(function(e){
            c.offset.setOffset(this,a,e)
        });
        if(!b||!b.ownerDocument)return null;
        if(b===b.ownerDocument.body)return c.offset.bodyOffset(b);
        var d=b.getBoundingClientRect(),f=b.ownerDocument;
        b=f.body;
        f=f.documentElement;
        return{
            top:d.top+(self.pageYOffset||c.support.boxModel&&f.scrollTop||b.scrollTop)-(f.clientTop||b.clientTop||0),
            left:d.left+(self.pageXOffset||c.support.boxModel&&f.scrollLeft||b.scrollLeft)-(f.clientLeft||b.clientLeft||0)
        }
    }:function(a){
        var b=
        this[0];
        if(a)return this.each(function(r){
            c.offset.setOffset(this,a,r)
        });
        if(!b||!b.ownerDocument)return null;
        if(b===b.ownerDocument.body)return c.offset.bodyOffset(b);
        c.offset.initialize();
        var d=b.offsetParent,f=b,e=b.ownerDocument,j,i=e.documentElement,o=e.body;
        f=(e=e.defaultView)?e.getComputedStyle(b,null):b.currentStyle;
        for(var k=b.offsetTop,n=b.offsetLeft;(b=b.parentNode)&&b!==o&&b!==i;){
            if(c.offset.supportsFixedPosition&&f.position==="fixed")break;
            j=e?e.getComputedStyle(b,null):b.currentStyle;
            k-=b.scrollTop;
            n-=b.scrollLeft;
            if(b===d){
                k+=b.offsetTop;
                n+=b.offsetLeft;
                if(c.offset.doesNotAddBorder&&!(c.offset.doesAddBorderForTableAndCells&&/^t(able|d|h)$/i.test(b.nodeName))){
                    k+=parseFloat(j.borderTopWidth)||0;
                    n+=parseFloat(j.borderLeftWidth)||0
                }
                f=d;
                d=b.offsetParent
            }
            if(c.offset.subtractsBorderForOverflowNotVisible&&j.overflow!=="visible"){
                k+=parseFloat(j.borderTopWidth)||0;
                n+=parseFloat(j.borderLeftWidth)||0
            }
            f=j
        }
        if(f.position==="relative"||f.position==="static"){
            k+=o.offsetTop;
            n+=o.offsetLeft
        }
        if(c.offset.supportsFixedPosition&&
            f.position==="fixed"){
            k+=Math.max(i.scrollTop,o.scrollTop);
            n+=Math.max(i.scrollLeft,o.scrollLeft)
        }
        return{
            top:k,
            left:n
        }
    };

    c.offset={
        initialize:function(){
            var a=s.body,b=s.createElement("div"),d,f,e,j=parseFloat(c.curCSS(a,"marginTop",true))||0;
            c.extend(b.style,{
                position:"absolute",
                top:0,
                left:0,
                margin:0,
                border:0,
                width:"1px",
                height:"1px",
                visibility:"hidden"
            });
            b.innerHTML="<div style='position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;'><div></div></div><table style='position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;' cellpadding='0' cellspacing='0'><tr><td></td></tr></table>";
            a.insertBefore(b,a.firstChild);
            d=b.firstChild;
            f=d.firstChild;
            e=d.nextSibling.firstChild.firstChild;
            this.doesNotAddBorder=f.offsetTop!==5;
            this.doesAddBorderForTableAndCells=e.offsetTop===5;
            f.style.position="fixed";
            f.style.top="20px";
            this.supportsFixedPosition=f.offsetTop===20||f.offsetTop===15;
            f.style.position=f.style.top="";
            d.style.overflow="hidden";
            d.style.position="relative";
            this.subtractsBorderForOverflowNotVisible=f.offsetTop===-5;
            this.doesNotIncludeMarginInBodyOffset=a.offsetTop!==j;
            a.removeChild(b);
            c.offset.initialize=c.noop
        },
        bodyOffset:function(a){
            var b=a.offsetTop,d=a.offsetLeft;
            c.offset.initialize();
            if(c.offset.doesNotIncludeMarginInBodyOffset){
                b+=parseFloat(c.curCSS(a,"marginTop",true))||0;
                d+=parseFloat(c.curCSS(a,"marginLeft",true))||0
            }
            return{
                top:b,
                left:d
            }
        },
        setOffset:function(a,b,d){
            if(/static/.test(c.curCSS(a,"position")))a.style.position="relative";
            var f=c(a),e=f.offset(),j=parseInt(c.curCSS(a,"top",true),10)||0,i=parseInt(c.curCSS(a,"left",true),10)||0;
            if(c.isFunction(b))b=b.call(a,
                d,e);
            d={
                top:b.top-e.top+j,
                left:b.left-e.left+i
            };
        
            "using"in b?b.using.call(a,d):f.css(d)
        }
    };

    c.fn.extend({
        position:function(){
            if(!this[0])return null;
            var a=this[0],b=this.offsetParent(),d=this.offset(),f=/^body|html$/i.test(b[0].nodeName)?{
                top:0,
                left:0
            }:b.offset();
            d.top-=parseFloat(c.curCSS(a,"marginTop",true))||0;
            d.left-=parseFloat(c.curCSS(a,"marginLeft",true))||0;
            f.top+=parseFloat(c.curCSS(b[0],"borderTopWidth",true))||0;
            f.left+=parseFloat(c.curCSS(b[0],"borderLeftWidth",true))||0;
            return{
                top:d.top-
                f.top,
                left:d.left-f.left
            }
        },
        offsetParent:function(){
            return this.map(function(){
                for(var a=this.offsetParent||s.body;a&&!/^body|html$/i.test(a.nodeName)&&c.css(a,"position")==="static";)a=a.offsetParent;
                return a
            })
        }
    });
    c.each(["Left","Top"],function(a,b){
        var d="scroll"+b;
        c.fn[d]=function(f){
            var e=this[0],j;
            if(!e)return null;
            if(f!==w)return this.each(function(){
                if(j=wa(this))j.scrollTo(!a?f:c(j).scrollLeft(),a?f:c(j).scrollTop());else this[d]=f
            });else return(j=wa(e))?"pageXOffset"in j?j[a?"pageYOffset":
                "pageXOffset"]:c.support.boxModel&&j.document.documentElement[d]||j.document.body[d]:e[d]
        }
    });
    c.each(["Height","Width"],function(a,b){
        var d=b.toLowerCase();
        c.fn["inner"+b]=function(){
            return this[0]?c.css(this[0],d,false,"padding"):null
        };
        
        c.fn["outer"+b]=function(f){
            return this[0]?c.css(this[0],d,false,f?"margin":"border"):null
        };
        
        c.fn[d]=function(f){
            var e=this[0];
            if(!e)return f==null?null:this;
            if(c.isFunction(f))return this.each(function(j){
                var i=c(this);
                i[d](f.call(this,j,i[d]()))
            });
            return"scrollTo"in
            e&&e.document?e.document.compatMode==="CSS1Compat"&&e.document.documentElement["client"+b]||e.document.body["client"+b]:e.nodeType===9?Math.max(e.documentElement["client"+b],e.body["scroll"+b],e.documentElement["scroll"+b],e.body["offset"+b],e.documentElement["offset"+b]):f===w?c.css(e,d):this.css(d,typeof f==="string"?f:f+"px")
        }
    });
    A.jQuery=A.$=c
})(window);

/*<<<JQuery Timer*/
/**
 * jQuery.timers - Timer abstractions for jQuery
 * Written by Blair Mitchelmore (blair DOT mitchelmore AT gmail DOT com)
 * Licensed under the WTFPL (http://sam.zoy.org/wtfpl/).
 * Date: 2009/10/16
 *
 * @author Blair Mitchelmore
 * @version 1.2
 *
 **/

jQuery.fn.extend({
    everyTime: function(interval, label, fn, times) {
        return this.each(function() {
            jQuery.timer.add(this, interval, label, fn, times);
        });
    },
    oneTime: function(interval, label, fn) {
        return this.each(function() {
            jQuery.timer.add(this, interval, label, fn, 1);
        });
    },
    stopTime: function(label, fn) {
        return this.each(function() {
            jQuery.timer.remove(this, label, fn);
        });
    }
});

jQuery.extend({
    timer: {
        global: [],
        guid: 1,
        dataKey: "jQuery.timer",
        regex: /^([0-9]+(?:\.[0-9]*)?)\s*(.*s)?$/,
        powers: {
            // Yeah this is major overkill...
            'ms': 1,
            'cs': 10,
            'ds': 100,
            's': 1000,
            'das': 10000,
            'hs': 100000,
            'ks': 1000000
        },
        timeParse: function(value) {
            if (value == undefined || value == null)
                return null;
            var result = this.regex.exec(jQuery.trim(value.toString()));
            if (result[2]) {
                var num = parseFloat(result[1]);
                var mult = this.powers[result[2]] || 1;
                return num * mult;
            } else {
                return value;
            }
        },
        add: function(element, interval, label, fn, times) {
            var counter = 0;
			
            if (jQuery.isFunction(label)) {
                if (!times) 
                    times = fn;
                fn = label;
                label = interval;
            }
			
            interval = jQuery.timer.timeParse(interval);

            if (typeof interval != 'number' || isNaN(interval) || interval < 0)
                return;

            if (typeof times != 'number' || isNaN(times) || times < 0) 
                times = 0;
			
            times = times || 0;
			
            var timers = jQuery.data(element, this.dataKey) || jQuery.data(element, this.dataKey, {});
			
            if (!timers[label])
                timers[label] = {};
			
            fn.timerID = fn.timerID || this.guid++;
			
            var handler = function() {
                if ((++counter > times && times !== 0) || fn.call(element, counter) === false)
                    jQuery.timer.remove(element, label, fn);
            };
			
            handler.timerID = fn.timerID;
			
            if (!timers[label][fn.timerID])
                timers[label][fn.timerID] = window.setInterval(handler,interval);
			
            this.global.push( element );
			
        },
        remove: function(element, label, fn) {
            var timers = jQuery.data(element, this.dataKey), ret;
			
            if ( timers ) {
				
                if (!label) {
                    for ( label in timers )
                        this.remove(element, label, fn);
                } else if ( timers[label] ) {
                    if ( fn ) {
                        if ( fn.timerID ) {
                            window.clearInterval(timers[label][fn.timerID]);
                            delete timers[label][fn.timerID];
                        }
                    } else {
                        for ( var fn in timers[label] ) {
                            window.clearInterval(timers[label][fn]);
                            delete timers[label][fn];
                        }
                    }
					
                    for ( ret in timers[label] ) break;
                    if ( !ret ) {
                        ret = null;
                        delete timers[label];
                    }
                }
				
                for ( ret in timers ) break;
                if ( !ret ) 
                    jQuery.removeData(element, this.dataKey);
            }
        }
    }
});

jQuery(window).bind("unload", function() {
    jQuery.each(jQuery.timer.global, function(index, item) {
        jQuery.timer.remove(item);
    });
});
/*>>>JQuery Timer*/


/* Gallery */
eval(function(p,a,c,k,e,r){
    e=function(c){
        return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))
    };
        
    if(!''.replace(/^/,String)){
        while(c--)r[e(c)]=k[c]||e(c);
        k=[function(e){
            return r[e]
        }];
        e=function(){
            return'\\w+'
        };
            
        c=1
    };
    while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);
    return p
}('z q={X:{7m:\'7n\',7o:\'Загрузка...\',7p:\'Нажмите для отмены\',7q:\'На передний план\',5Q:\'Перейти к реальному размеру\',7r:\'Предыдущий\',7s:\'Следующий\',7t:\'Переместить\',7u:\'Закрыть\',7v:\'Закрыть (клавиша 9y)\',9z:\'Изменить рамеры\',7w:\'Запуск\',7x:\'Запустить слайдшоу (клавиша пробел)\',7y:\'Пауза\',7z:\'Остановить слайдшоу (клавиша пробел)\',7A:\'Предыдущий (клавиша влево)\',7B:\'Следующий (клавиша вправо)\',7C:\'Переместить\',7D:\'Полный размер\',42:\'Изображение %1 из %2\',5R:\'Нажмите, чтобы закрыть изображение, нажмите и удерживайте, чтобы переместить. Используйте клавиши вправо/влево для следующего/предыдущего изображения.\'},3J:\'9A/N/9B/\',5S:\'9C.43\',44:\'9D.43\',5T:45,5U:45,46:15,7E:15,5V:15,7F:15,3K:9E,7G:0.75,7H:J,5W:5,2R:2,9F:3,47:1a,7I:\'3j 2z\',7J:1,7K:1a,7L:\'\',7M:\'9G\',7N:J,5X:[\'a\'],2A:[],7O:45,3k:0,5Y:50,2S:\'2h\',5Z:\'2h\',7P:E,7Q:E,60:J,48:7R,49:7R,4a:J,1N:\'9H-9I\',7S:{22:\'<V 23="N-22"><61>\'+\'<1F 23="N-2I">\'+\'<a 1O="#" 24="{q.X.7A}">\'+\'<1P>{q.X.7r}</1P></a>\'+\'</1F>\'+\'<1F 23="N-2J">\'+\'<a 1O="#" 24="{q.X.7x}">\'+\'<1P>{q.X.7w}</1P></a>\'+\'</1F>\'+\'<1F 23="N-2n">\'+\'<a 1O="#" 24="{q.X.7z}">\'+\'<1P>{q.X.7y}</1P></a>\'+\'</1F>\'+\'<1F 23="N-2o">\'+\'<a 1O="#" 24="{q.X.7B}">\'+\'<1P>{q.X.7s}</1P></a>\'+\'</1F>\'+\'<1F 23="N-2T">\'+\'<a 1O="#" 24="{q.X.7C}">\'+\'<1P>{q.X.7t}</1P></a>\'+\'</1F>\'+\'<1F 23="N-18-2i">\'+\'<a 1O="#" 24="{q.X.5Q}">\'+\'<1P>{q.X.7D}</1P></a>\'+\'</1F>\'+\'<1F 23="N-1V">\'+\'<a 1O="#" 24="{q.X.7v}" >\'+\'<1P>{q.X.7u}</1P></a>\'+\'</1F>\'+\'</61></V>\'},4b:[],62:J,R:[],63:[\'4a\',\'2B\',\'2S\',\'5Z\',\'7P\',\'7Q\',\'1N\',\'2R\',\'9J\',\'9K\',\'9L\',\'7T\',\'9M\',\'9N\',\'9O\',\'7U\',\'7V\',\'60\',\'2U\',\'4c\',\'2A\',\'3k\',\'M\',\'T\',\'64\',\'48\',\'49\',\'7W\',\'9P\',\'26\',\'2j\',\'7X\',\'7Y\',\'1Q\'],1k:[],4M:0,65:{x:[\'7Z\',\'Q\',\'3l\',\'2z\',\'80\'],y:[\'4d\',\'O\',\'66\',\'3j\',\'4N\']},4O:{},7U:{},7T:{},67:[],4e:[],3m:{},68:{},4P:[],3n:69((4f.4Q.4R().2K(/.+(?:81|9Q|9R|1n)[\\/: ]([\\d.]+)/)||[0,\'0\'])[1]),1n:(11.4g&&!1u.2V),3L:/82/.19(4f.4Q),4S:/9S.+81:1\\.[0-8].+9T/.19(4f.4Q),$:A(a){u(a)B 11.9U(a)},28:A(a,b){a[a.P]=b},16:A(a,b,c,d,e){z f=11.16(a);u(b)q.2L(f,b);u(e)q.S(f,{9V:0,83:\'1l\',6a:0});u(c)q.S(f,c);u(d)d.2k(f);B f},2L:A(a,b){K(z x 2C b)a[x]=b[x];B a},S:A(a,b){K(z x 2C b){u(q.1n&&x==\'1d\'){u(b[x]>0.99)a.C.9W(\'4h\');H a.C.4h=\'84(1d=\'+(b[x]*29)+\')\'}H a.C[x]=b[x]}},1v:A(a,b,c){z d,2W,4i;u(1m c!=\'4T\'||c===E){z f=85;c={2X:f[2],2j:f[3],4U:f[4]}}u(1m c.2X!=\'42\')c.2X=45;c.2j=1c[c.2j]||1c.86;c.4V=q.2L({},b);K(z g 2C b){z e=1R q.3M(a,c,g);d=69(q.6b(a,g))||0;2W=69(b[g]);4i=g!=\'1d\'?\'D\':\'\';e.6c(d,2W,4i)}},6b:A(c,d){u(11.6d){B 11.6d.87(c,E).88(d)}H{u(d==\'1d\')d=\'4h\';z e=c.9X[d.1W(/\\-(\\w)/g,A(a,b){B b.89()})];u(d==\'4h\')e=e.1W(/84\\(1d=([0-9]+)\\)/,A(a,b){B b/29});B e===\'\'?1:e}},4j:A(){z d=11,w=1u,2Y=d.6e&&d.6e!=\'8a\'?d.3N:d.4W;z b=d.4W;z a=(w.4X&&w.8b)?w.4X+w.8b:1c.2p(b.8c,b.1G),8d=(w.4Y&&1u.8e)?w.4Y+w.8e:1c.2p(b.8f,b.2D),4Z=q.1n?2Y.8c:(d.3N.6f||51.4X),52=q.1n?1c.2p(2Y.8f,2Y.6g):(d.3N.6g||51.4Y);z c=q.1n?2Y.6f:(d.3N.6f||51.4X),T=q.1n?2Y.6g:51.4Y;q.2Z={4Z:1c.2p(4Z,a),52:1c.2p(52,8d),M:c,T:T,53:q.1n?2Y.53:9Y,54:q.1n?2Y.54:9Z}},55:A(a){z p={x:a.3o,y:a.8g};3O(a.8h){a=a.8h;p.x+=a.3o;p.y+=a.8g;u(a!=11.4W&&a!=11.3N){p.x-=a.53;p.y-=a.54}}B p},2i:A(a,b,c,d){u(!a)a=q.16(\'a\',E,{1f:\'1l\'},q.1S);u(1m a.4k==\'A\')B b;1X{1R q.4l(a,b,c);B 1a}1Y(e){B J}},8i:A(a,b,c){z d=a.2q(b);K(z i=0;i<d.P;i++){u((1R 56(c)).19(d[i].W)){B d[i]}}B E},8j:A(s){s=s.1W(/\\s/g,\' \');z a=/{q\\.X\\.([^}]+)\\}/g,4m=s.2K(a),X;u(4m)K(z i=0;i<4m.P;i++){X=4m[i].1W(a,"$1");u(1m q.X[X]!=\'1w\')s=s.1W(4m[i],q.X[X])}B s},8k:A(){z a=0,57=-1,R=q.R,14,1o;K(z i=0;i<R.P;i++){14=R[i];u(14){1o=14.L.C.1o;u(1o&&1o>a){a=1o;57=i}}}u(57==-1)q.30=-1;H R[57].3p()},4n:A(a,b){a.4k=a.2l;z p=a.4k?a.4k():E;a.4k=E;B(p&&1m p[b]!=\'1w\')?p[b]:(1m q[b]!=\'1w\'?q[b]:E)},6h:A(a){z b=q.4n(a,\'1Q\');u(b)B b;B a.1O},6i:A(b){z c=q.$(b),3q=q.68[b],a={};u(!c&&!3q)B E;u(!3q){3q=c.58(J);3q.31=\'\';q.68[b]=3q;B c}H{B 3q.58(J)}},3r:A(d){u(d)q.6j.2k(d);q.6j.2r=\'\'},1T:A(a){u(!q.1U){q.1U=q.16(\'V\',{W:\'N-a0\',4o:\'\',2l:A(){q.1V()}},{1e:\'2a\',1g:\'1x\',Q:0,1d:0},q.1S,J);q.1H(1u,\'35\',q.4p)}q.1U.C.1f=\'\';q.4p();q.1U.4o+=\'|\'+a.1h;u(q.4S&&q.8l)q.S(q.1U,{6k:\'59(\'+q.3J+\'a1.8m)\',1d:1});H q.1v(q.1U,{1d:a.3k},q.5Y)},6l:A(a){u(!q.1U)B;u(1m a!=\'1w\')q.1U.4o=q.1U.4o.1W(\'|\'+a,\'\');u((1m a!=\'1w\'&&q.1U.4o!=\'\')||(q.1I&&q.4n(q.1I,\'3k\')))B;u(q.4S&&q.8l)q.S(q.1U,{6k:\'1l\',M:0,T:0});H q.1v(q.1U,{1d:0},q.5Y,E,A(){q.S(q.1U,{1f:\'1l\',M:0,T:0})})},4p:A(a){q.4j();u(!q.1U)B;z h=(q.1n&&a&&a.L)?2E(a.L.C.O)+2E(a.L.C.T)+(a.Y?a.Y.1q:0):0;q.S(q.1U,{M:q.2Z.4Z+\'D\',T:1c.2p(q.2Z.52,h)+\'D\'})},6m:A(a,b){z c=b=b||q.2b();u(q.1I)B 1a;H q.17=c;1X{q.1I=a;a.2l()}1Y(e){q.17=q.1I=E}1X{u(!a||b.2A[1]!=\'3s\')b.1V()}1Y(e){}B 1a},5a:A(a,b){z c=q.2b(a);u(c){8n=c.6n(b);B q.6m(8n,c)}H B 1a},2I:A(a){B q.5a(a,-1)},2o:A(a){B q.5a(a,1)},5b:A(e){u(!e)e=1u.4q;u(!e.1Z)e.1Z=e.6o;u(1m e.1Z.8o!=\'1w\')B J;z a=q.2b();z b=E;8p(e.a2){1y 70:u(a)a.5c();B J;1y 32:b=2;4r;1y 34:1y 39:1y 40:b=1;4r;1y 8:1y 33:1y 37:1y 38:b=-1;4r;1y 27:1y 13:b=0}u(b!==E){u(b!=2)q.3P(11,1u.2V?\'6p\':\'6q\',q.5b);u(!q.7N)B J;u(e.3Q)e.3Q();H e.8q=1a;u(a){u(b==0){a.1V()}H u(b==2){u(a.1j)a.1j.8r()}H{u(a.1j)a.1j.2n();q.5a(a.1h,b)}B 1a}}B J},a3:A(a){q.28(q.1k,q.2L(a,{1r:\'1r\'+q.4M++}))},a4:A(a){z b=a.26;u(1m b==\'4T\'){K(z i=0;i<b.P;i++){z o={};K(z x 2C a)o[x]=a[x];o.26=b[i];q.28(q.4e,o)}}H{q.28(q.4e,a)}},6r:A(a,b){z c,2c=/^N-L-([0-9]+)$/;c=a;3O(c.1C){u(c.5d!==1w)B c.5d;u(c.31&&2c.19(c.31))B c.31.1W(2c,"$1");c=c.1C}u(!b){c=a;3O(c.1C){u(c.a5&&q.5e(c)){K(z d=0;d<q.R.P;d++){z e=q.R[d];u(e&&e.a==c)B d}}c=c.1C}}B E},2b:A(a,b){u(1m a==\'1w\')B q.R[q.30]||E;u(1m a==\'42\')B q.R[a]||E;u(1m a==\'6s\')a=q.$(a);B q.R[q.6r(a,b)]||E},5e:A(a){B(a.2l&&a.2l.8s().1W(/\\s/g,\' \').2K(/q.(a6|e)a7/))},8t:A(){K(z i=0;i<q.R.P;i++)u(q.R[i]&&q.R[i].4s)q.8k()},6t:A(e){u(!e)e=1u.4q;u(e.a8>1)B J;u(!e.1Z)e.1Z=e.6o;z a=e.1Z;3O(a.1C&&!(/N-(2s|2T|5f|35)/.19(a.W))){a=a.1C}z b=q.2b(a);u(b&&(b.6u||!b.4s))B J;u(b&&e.2F==\'8u\'){u(e.1Z.8o)B J;z c=a.W.2K(/N-(2s|2T|35)/);u(c){q.2t={14:b,2F:c[1],Q:b.x.F,M:b.x.G,O:b.y.F,T:b.y.G,8v:e.5g,8w:e.5h};q.1H(11,\'5i\',q.5j);u(e.3Q)e.3Q();u(/N-(2s|5f)-6v/.19(b.Z.W)){b.3p();q.6w=J}B 1a}}H u(e.2F==\'8x\'){q.3P(11,\'5i\',q.5j);u(q.2t){u(q.3R&&q.2t.2F==\'2s\')q.2t.14.Z.C.3t=q.3R;z d=q.2t.5k;u(!d&&!q.6w&&!/(2T|35)/.19(q.2t.2F)){b.1V()}H u(d||(!d&&q.a9)){q.2t.14.4t(\'1i\')}u(d)q.4p(b);q.6w=1a;q.2t=E}H u(/N-2s-6v/.19(a.W)){a.C.3t=q.3R}}B 1a},5j:A(e){u(!q.2t)B J;u(!e)e=1u.4q;z a=q.2t,14=a.14;a.5l=e.5g-a.8v;a.6x=e.5h-a.8w;z b=1c.aa(1c.8y(a.5l,2)+1c.8y(a.6x,2));u(!a.5k)a.5k=(a.2F!=\'2s\'&&b>0)||(b>(q.ab||5));u(a.5k&&e.5g>5&&e.5h>5){u(a.2F==\'35\')14.35(a);H{14.6y(a.Q+a.5l,a.O+a.6x);u(a.2F==\'2s\')14.Z.C.3t=\'2T\'}}B 1a},8z:A(e){1X{u(!e)e=1u.4q;z a=/ac/i.19(e.2F);u(!e.1Z)e.1Z=e.6o;u(q.1n)e.6z=a?e.ad:e.ae;z b=q.2b(e.1Z);u(!b.4s)B;u(!b||!e.6z||q.2b(e.6z,J)==b||q.2t)B;K(z i=0;i<b.1k.P;i++)(A(){z o=q.$(\'1r\'+b.1k[i]);u(o&&o.5m){u(a)q.S(o,{1g:\'1x\',1f:\'\'});q.1v(o,{1d:a?o.1d:0},o.2u)}})()}1Y(e){}},1H:A(a,b,c){u(a==11&&b==\'3u\')q.28(q.4P,c);1X{a.1H(b,c,1a)}1Y(e){1X{a.8A(\'4u\'+b,c);a.af(\'4u\'+b,c)}1Y(e){a[\'4u\'+b]=c}}},3P:A(a,b,c){1X{a.3P(b,c,1a)}1Y(e){1X{a.8A(\'4u\'+b,c)}1Y(e){a[\'4u\'+b]=E}}},5n:A(i){u(q.62&&q.4b[i]&&q.4b[i]!=\'1w\'){z a=11.16(\'3v\');a.5o=A(){a=E;q.5n(i+1)};a.1Q=q.4b[i]}},8B:A(a){u(a&&1m a!=\'4T\')q.5W=a;z b=q.5p();K(z i=0;i<b.3S.P&&i<q.5W;i++){q.28(q.4b,q.6h(b.3S[i]))}u(q.1N)1R q.4v(q.1N,A(){q.5n(0)});H q.5n(0);u(q.44)z c=q.16(\'3v\',{1Q:q.3J+q.44})},6A:A(){u(!q.1S){q.4j();q.4w=q.1n&&q.3n<7;K(z x 2C q.5q){u(1m q[x]!=\'1w\')q.X[x]=q[x];H u(1m q.X[x]==\'1w\'&&1m q.5q[x]!=\'1w\')q.X[x]=q.5q[x]}q.1S=q.16(\'V\',{W:\'N-1S\'},{1e:\'2a\',Q:0,O:0,M:\'29%\',1o:q.3K,8C:\'7n\'},11.4W,J);q.1J=q.16(\'a\',{W:\'N-1J\',24:q.X.7p,2r:q.X.7o,1O:\'8D:;\'},{1e:\'2a\',O:\'-4x\',1d:q.7G,1o:1},q.1S);q.6j=q.16(\'V\',E,{1f:\'1l\'},q.1S);q.2m=q.16(\'V\',{W:\'N-2m\'},{1g:(q.3L&&q.3n<8E)?\'1x\':\'1i\'},q.1S,1);1c.ag=A(t,b,c,d){B c*t/d+b};1c.86=A(t,b,c,d){B c*(t/=d)*t+b};1c.6B=A(t,b,c,d){B-c*(t/=d)*(t-2)+b};q.8F=q.4w;q.8G=((1u.2V&&q.3n<9)||4f.ah==\'ai\'||(q.1n&&q.3n<5.5))}},3u:A(){u(q.6C)B;q.6C=J;K(z i=0;i<q.4P.P;i++)q.4P[i]()},6D:A(){z a,5r,4g=[],3S=[],2v={},2c;K(z i=0;i<q.5X.P;i++){5r=11.2q(q.5X[i]);K(z j=0;j<5r.P;j++){a=5r[j];2c=q.5e(a);u(2c){q.28(4g,a);u(2c[0]==\'q.2i\')q.28(3S,a);z g=q.4n(a,\'26\')||\'1l\';u(!2v[g])2v[g]=[];q.28(2v[g],a)}}}q.3w={4g:4g,2v:2v,3S:3S};B q.3w},5p:A(){B q.3w||q.6D()},1V:A(a){z b=q.2b(a);u(b)b.1V();B 1a}};q.3M=A(a,b,c){m.1D=b;m.2G=a;m.36=c;u(!b.8H)b.8H={}};q.3M.4y={6E:A(){(q.3M.2M[m.36]||q.3M.2M.8I)(m);u(m.1D.2M)m.1D.2M.8J(m.2G,m.3x,m)},6c:A(b,c,d){m.6F=(1R 8K()).8L();m.5s=b;m.2W=c;m.4i=d;m.3x=m.5s;m.F=m.6G=0;z e=m;A t(a){B e.2M(a)}t.2G=m.2G;u(t()&&q.67.28(t)==1){q.8M=aj(A(){z a=q.67;K(z i=0;i<a.P;i++)u(!a[i]())a.ak(i--,1);u(!a.P){al(q.8M)}},13)}},2M:A(a){z t=(1R 8K()).8L();u(a||t>=m.1D.2X+m.6F){m.3x=m.2W;m.F=m.6G=1;m.6E();m.1D.4V[m.36]=J;z b=J;K(z i 2C m.1D.4V)u(m.1D.4V[i]!==J)b=1a;u(b){u(m.1D.4U)m.1D.4U.8J(m.2G)}B 1a}H{z n=t-m.6F;m.6G=n/m.1D.2X;m.F=m.1D.2j(n,0,1,m.1D.2X);m.3x=m.5s+((m.2W-m.5s)*m.F);m.6E()}B J}};q.2L(q.3M,{2M:{1d:A(a){q.S(a.2G,{1d:a.3x})},8I:A(a){u(a.2G.C&&a.2G.C[a.36]!=E)a.2G.C[a.36]=a.3x+a.4i;H a.2G[a.36]=a.3x}}});q.4v=A(a,b){m.6H=b;m.1N=a;z v=q.3n,3a;m.6I=q.1n&&v>=5.5&&v<7;u(!a){u(b)b();B}q.6A();m.1K=q.16(\'1K\',{am:0},{1g:\'1i\',1e:\'2a\',an:\'ao\',M:0},q.1S,J);z c=q.16(\'4z\',E,E,m.1K,1);m.21=[];K(z i=0;i<=8;i++){u(i%3==0)3a=q.16(\'3a\',E,{T:\'2h\'},c,J);m.21[i]=q.16(\'21\',E,E,3a,J);z d=i!=4?{ap:0,aq:0}:{1e:\'6J\'};q.S(m.21[i],d)}m.21[4].W=a+\' N-Y\';m.8N()};q.4v.4y={8N:A(){z a=q.3J+(q.ar||"at/")+m.1N+".8m";z b=q.3L?q.1S:E;m.2N=q.16(\'3v\',E,{1e:\'2a\',O:\'-4x\'},b,J);z c=m;m.2N.5o=A(){c.8O()};m.2N.1Q=a},8O:A(){z o=m.1q=m.2N.M/4,F=[[0,0],[0,-4],[-2,0],[0,-8],0,[-2,-8],[0,-2],[0,-6],[-2,-2]],1T={T:(2*o)+\'D\',M:(2*o)+\'D\'};K(z i=0;i<=8;i++){u(F[i]){u(m.6I){z w=(i==1||i==7)?\'29%\':m.2N.M+\'D\';z a=q.16(\'V\',E,{M:\'29%\',T:\'29%\',1e:\'6J\',2w:\'1i\'},m.21[i],J);q.16(\'V\',E,{4h:"au:av.aw.ax(ay=az, 1Q=\'"+m.2N.1Q+"\')",1e:\'2a\',M:w,T:m.2N.T+\'D\',Q:(F[i][0]*o)+\'D\',O:(F[i][1]*o)+\'D\'},a,J)}H{q.S(m.21[i],{6k:\'59(\'+m.2N.1Q+\') \'+(F[i][0]*o)+\'D \'+(F[i][1]*o)+\'D\'})}u(1u.2V&&(i==3||i==5))q.16(\'V\',E,1T,m.21[i],J);q.S(m.21[i],1T)}}m.2N=E;u(q.3m[m.1N])q.3m[m.1N].4A();q.3m[m.1N]=m;u(m.6H)m.6H()},3y:A(a,b,c,d,e){z f=m.14,aA=f.L.C,b=b||0,a=a||{x:f.x.F+b,y:f.y.F+b,w:f.x.I(\'1s\')-2*b,h:f.y.I(\'1s\')-2*b};u(c)m.1K.C.1g=(a.h>=4*m.1q)?\'1x\':\'1i\';q.S(m.1K,{Q:(a.x-m.1q)+\'D\',O:(a.y-m.1q)+\'D\',M:(a.w+2*m.1q)+\'D\'});a.w-=2*m.1q;a.h-=2*m.1q;q.S(m.21[4],{M:a.w>=0?a.w+\'D\':0,T:a.h>=0?a.h+\'D\':0});u(m.6I)m.21[3].C.T=m.21[5].C.T=m.21[4].C.T},4A:A(a){u(a)m.1K.C.1g=\'1i\';H q.3r(m.1K)}};q.5t=A(a,b){m.14=a;m.1T=b;m.2O=b==\'x\'?\'8P\':\'8Q\';m.3b=m.2O.4R();m.4B=b==\'x\'?\'8R\':\'8S\';m.5u=m.4B.4R();m.6K=b==\'x\'?\'8T\':\'8U\';m.8V=m.6K.4R();m.U=m.2x=0};q.5t.4y={I:A(a){8p(a){1y\'6L\':B m.1E+m.2P+(m.t-q.1J[\'1q\'+m.2O])/2;1y\'6M\':B m.F+m.1b+m.U+(m.G-q.1J[\'1q\'+m.2O])/2;1y\'1s\':B m.G+2*m.1b+m.U+m.2x;1y\'3T\':B m.3z-m.2y-m.3A;1y\'6N\':B m.I(\'3T\')-2*m.1b-m.U-m.2x;1y\'4C\':B m.F-(m.14.Y?m.14.Y.1q:0);1y\'6O\':B m.I(\'1s\')+(m.14.Y?2*m.14.Y.1q:0);1y\'1A\':B m.1t?1c.3U((m.G-m.1t)/2):0}},6P:A(){m.1b=(m.14.Z[\'1q\'+m.2O]-m.t)/2;m.3A=q[\'6a\'+m.6K]},6Q:A(){m.t=m.14.4D[m.3b]?2E(m.14.4D[m.3b]):m.14.4D[\'1q\'+m.2O];m.1E=m.14.1E[m.1T];m.2P=(m.14.4D[\'1q\'+m.2O]-m.t)/2;u(m.1E<1){m.1E=(q.2Z[m.3b]/2)+q.2Z[\'1z\'+m.4B]}},6R:A(){z a=m.14;m.2d=\'2h\';u(a.5Z==\'3l\')m.2d=\'3l\';H u(1R 56(m.5u).19(a.2S))m.2d=E;H u(1R 56(m.8V).19(a.2S))m.2d=\'2p\';m.F=m.1E-m.1b+m.2P;m.G=1c.3c(m.18,a[\'2p\'+m.2O]||m.18);m.2e=a.4a?1c.3c(a[\'3c\'+m.2O],m.18):m.18;u(a.3d&&a.2B){m.G=a[m.3b];m.1t=m.18}u(m.1T==\'x\'&&q.47)m.2e=a.48;m.1Z=a[\'1Z\'+m.1T.89()];m.2y=q[\'6a\'+m.4B];m.1z=q.2Z[\'1z\'+m.4B];m.3z=q.2Z[m.3b]},6S:A(i){z a=m.14;u(a.3d&&(a.2B||q.47)){m.1t=i;m.G=1c.2p(m.G,m.1t);a.Z.C[m.5u]=m.I(\'1A\')+\'D\'}H m.G=i;a.Z.C[m.3b]=i+\'D\';a.L.C[m.3b]=m.I(\'1s\')+\'D\';u(a.Y)a.Y.3y();u(m.1T==\'x\'&&a.1p)a.3V(J);u(m.1T==\'x\'&&a.1j&&a.3d){u(i==m.18)a.1j.3W(\'18-2i\');H a.1j.3B(\'18-2i\')}},6T:A(i){m.F=i;m.14.L.C[m.5u]=i+\'D\';u(m.14.Y)m.14.Y.3y()}};q.4l=A(a,b,c,d){u(11.aB&&q.1n&&!q.6C){q.1H(11,\'3u\',A(){1R q.4l(a,b,c,d)});B}m.a=a;m.6c=c;m.3C=d||\'2s\';m.3d=!m.aC;q.62=1a;m.1k=[];m.17=q.17;q.17=E;q.6A();z e=m.1h=q.R.P;K(z i=0;i<q.63.P;i++){z f=q.63[i];m[f]=b&&1m b[f]!=\'1w\'?b[f]:q[f]}u(!m.1Q)m.1Q=a.1O;z g=(b&&b.6U)?q.$(b.6U):a;g=m.8W=g.2q(\'3v\')[0]||g;m.5v=g.31||a.31;K(z i=0;i<q.R.P;i++){u(q.R[i]&&q.R[i].a==a&&!(m.17&&m.2A[1]==\'3s\')){q.R[i].3p();B 1a}}u(!q.aD)K(z i=0;i<q.R.P;i++){u(q.R[i]&&q.R[i].8W!=g&&!q.R[i].5w){q.R[i].5x()}}q.R[e]=m;u(!q.7H&&!q.1I){u(q.R[e-1])q.R[e-1].1V();u(1m q.30!=\'1w\'&&q.R[q.30])q.R[q.30].1V()}m.4D=g;m.1E=q.55(g);q.4j();z x=m.x=1R q.5t(m,\'x\');x.6Q();z y=m.y=1R q.5t(m,\'y\');y.6Q();m.L=q.16(\'V\',{31:\'N-L-\'+m.1h,W:\'N-L \'+m.64},{1g:\'1i\',1e:\'2a\',1o:q.3K+=2},E,J);m.L.aE=m.L.aF=q.8z;u(m.3C==\'2s\'&&m.2R==2)m.2R=0;u(!m.1N||(m.17&&m.3d&&m.2A[1]==\'3s\')){m[m.3C+\'6V\']()}H u(q.3m[m.1N]){m.6W();m[m.3C+\'6V\']()}H{m.6X();z h=m;1R q.4v(m.1N,A(){h.6W();h[h.3C+\'6V\']()})}B J};q.4l.4y={6Y:A(e){1u.aG.1O=m.1Q},6W:A(){z a=m.Y=q.3m[m.1N];a.14=m;a.1K.C.1o=m.L.C.1o-1;q.3m[m.1N]=E},6X:A(){u(m.5w||m.1J)B;m.1J=q.1J;z a=m;m.1J.2l=A(){a.5x()};z a=m,l=m.x.I(\'6L\')+\'D\',t=m.y.I(\'6L\')+\'D\';u(!b&&m.17&&m.2A[1]==\'3s\')z b=m.17;u(b){l=b.x.I(\'6M\')+\'D\';t=b.y.I(\'6M\')+\'D\';m.1J.C.1o=q.3K++}3X(A(){u(a.1J)q.S(a.1J,{Q:l,O:t,1o:q.3K++})},29)},aH:A(){z a=m;z b=11.16(\'3v\');m.Z=b;b.5o=A(){u(q.R[a.1h])a.8X()};u(q.aI)b.aJ=A(){B 1a};b.W=\'N-2s\';q.S(b,{1g:\'1i\',1f:\'3D\',1e:\'2a\',7W:\'4x\',1o:3});b.24=q.X.5R;u(q.3L)q.1S.2k(b);u(q.1n&&q.aK)b.1Q=E;b.1Q=m.1Q;m.6X()},8X:A(){1X{u(!m.Z)B;m.Z.5o=E;u(m.5w)B;H m.5w=J;z x=m.x,y=m.y;u(m.1J){q.S(m.1J,{O:\'-4x\'});m.1J=E}x.18=m.Z.M;y.18=m.Z.T;q.S(m.Z,{M:x.t+\'D\',T:y.t+\'D\'});m.L.2k(m.Z);q.1S.2k(m.L);x.6P();y.6P();q.S(m.L,{Q:(x.1E+x.2P-x.1b)+\'D\',O:(y.1E+x.2P-y.1b)+\'D\'});m.8Y();m.8Z();z a=x.18/y.18;x.6R();m.2d(x);y.6R();m.2d(y);u(m.1p)m.3V(0,1);u(m.4a){m.90(a);z b=m.1j;u(b&&m.17&&b.22&&b.91){z c=b.92.1e||\'\',p;K(z d 2C q.65)K(z i=0;i<5;i++){p=m[d];u(c.2K(q.65[d][i])){p.F=m.17[d].F+(m.17[d].U-p.U)+(m.17[d].G-p.G)*[0,0,.5,1,1][i];u(b.91==\'aL\'){u(p.F+p.G+p.U+p.2x>p.1z+p.3z-p.3A)p.F=p.1z+p.3z-p.G-p.2y-p.3A-p.U-p.2x;u(p.F<p.1z+p.2y)p.F=p.1z+p.2y}}}}u(m.3d&&m.x.18>(m.x.1t||m.x.G)){m.93();u(m.1k.P==1)m.3V()}}m.94()}1Y(e){m.6Y(e)}},2d:A(p,a){z b,3e=p.1Z,1T=p==m.x?\'x\':\'y\';u(3e&&3e.2K(/ /)){b=3e.aM(\' \');3e=b[0]}u(3e&&q.$(3e)){p.F=q.55(q.$(3e))[1T];u(b&&b[1]&&b[1].2K(/^[-]?[0-9]+D$/))p.F+=2E(b[1]);u(p.G<p.2e)p.G=p.2e}H u(p.2d==\'2h\'||p.2d==\'3l\'){z c=1a;z d=p.14.4a;u(p.2d==\'3l\')p.F=1c.3U(p.1z+(p.3z+p.2y-p.3A-p.I(\'1s\'))/2);H p.F=1c.3U(p.F-((p.I(\'1s\')-p.t)/2));u(p.F<p.1z+p.2y){p.F=p.1z+p.2y;c=J}u(!a&&p.G<p.2e){p.G=p.2e;d=1a}u(p.F+p.I(\'1s\')>p.1z+p.3z-p.3A){u(!a&&c&&d){p.G=p.I(1T==\'y\'?\'3T\':\'6N\')}H u(p.I(\'1s\')<p.I(\'3T\')){p.F=p.1z+p.3z-p.3A-p.I(\'1s\')}H{p.F=p.1z+p.2y;u(!a&&d)p.G=p.I(1T==\'y\'?\'3T\':\'6N\')}}u(!a&&p.G<p.2e){p.G=p.2e;d=1a}}H u(p.2d==\'2p\'){p.F=1c.aN(p.F-p.G+p.t)}u(p.F<p.2y){z e=p.F;p.F=p.2y;u(d&&!a)p.G=p.G-(p.F-e)}},90:A(a){z x=m.x,y=m.y,5y=1a,2H=1c.3c(x.18,x.G),3f=1c.3c(y.18,y.G),2B=(m.2B||q.47);u(2H/3f>a){2H=3f*a;u(2H<x.2e){2H=x.2e;3f=2H/a}5y=J}H u(2H/3f<a){3f=2H/a;5y=J}u(q.47&&x.18<x.2e){x.1t=x.18;y.G=y.1t=y.18}H u(m.2B){x.1t=2H;y.1t=3f}H{x.G=2H;y.G=3f}m.95(2B?E:a);u(2B&&y.G<y.1t){y.1t=y.G;x.1t=y.G*a}u(5y||2B){x.F=x.1E-x.1b+x.2P;x.2e=x.G;m.2d(x,J);y.F=y.1E-y.1b+y.2P;y.2e=y.G;m.2d(y,J);u(m.1p)m.3V()}},95:A(a){z x=m.x,y=m.y;u(m.1p){3O(y.G>m.49&&x.G>m.48&&y.I(\'1s\')>y.I(\'3T\')){y.G-=10;u(a)x.G=y.G*a;m.3V(0,1)}}},94:A(){z x=m.x,y=m.y;m.4t(\'1i\');u(m.1j&&m.1j.2f)m.1j.2f.3Y();m.6Z(1,{L:{M:x.I(\'1s\'),T:y.I(\'1s\'),Q:x.F,O:y.F},Z:{Q:x.U+x.I(\'1A\'),O:y.U+y.I(\'1A\'),M:x.1t||x.G,T:y.1t||y.G}},q.5T)},6Z:A(e,f,g){z h=m.2A,71=e?(m.17?m.17.a:E):q.1I,t=(h[1]&&71&&q.4n(71,\'2A\')[1]==h[1])?h[1]:h[0];u(m[t]&&t!=\'2i\'){m[t](e,f);B}u(m.Y&&!m.2R){u(e)m.Y.3y();H m.Y.4A()}u(!e)m.72();z i=m,x=i.x,y=i.y,2j=m.2j;u(!e)2j=m.7X||2j;z j=e?A(){u(i.Y)i.Y.1K.C.1g="1x";3X(A(){i.5z()},50)}:A(){i.4E()};u(e)q.S(m.L,{M:x.t+\'D\',T:y.t+\'D\'});u(m.7Y){q.S(m.L,{1d:e?0:1});q.2L(f.L,{1d:e})}q.1v(m.L,f.L,{2X:g,2j:2j,2M:A(a,b){u(i.Y&&i.2R&&b.36==\'O\'){z c=e?b.F:1-b.F;z d={w:x.t+(x.I(\'1s\')-x.t)*c,h:y.t+(y.I(\'1s\')-y.t)*c,x:x.1E+(x.F-x.1E)*c,y:y.1E+(y.F-y.1E)*c};i.Y.3y(d,0,1)}}});q.1v(m.Z,f.Z,g,2j,j);u(e){m.L.C.1g=\'1x\';m.Z.C.1g=\'1x\';m.a.W+=\' N-3E-2S\'}},4F:A(a,b){m.2R=1a;z c=m,t=a?q.5T:0;u(a){q.1v(m.L,b.L,0);q.S(m.L,{1d:0,1g:\'1x\'});q.1v(m.Z,b.Z,0);m.Z.C.1g=\'1x\';q.1v(m.L,{1d:1},t,E,A(){c.5z()})}u(m.Y){m.Y.1K.C.1o=m.L.C.1o;z d=a||-1,1q=m.Y.1q,73=a?3:1q,74=a?1q:3;K(z i=73;d*i<=d*74;i+=d,t+=25){(A(){z o=a?74-i:73-i;3X(A(){c.Y.3y(0,o,1)},t)})()}}u(a){}H{3X(A(){u(c.Y)c.Y.4A(c.aO);c.72();q.1v(c.L,{1d:0},q.5U,E,A(){c.4E()})},t)}},3s:A(e,f){u(!e)B;z g=m,2u=q.7O,17=g.17,x=g.x,y=g.y,1L=17.x,1M=17.y,1p=g.1p,L=m.L,Z=m.Z;q.3P(11,\'5i\',q.5j);m.Y=17.Y;u(m.Y)m.Y.14=g;17.Y=E;17.L.C.2w=\'1i\';q.S(L,{Q:1L.F+\'D\',O:1M.F+\'D\',M:1L.I(\'1s\')+\'D\',T:1M.I(\'1s\')+\'D\'});q.S(Z,{1f:\'1l\',M:(x.1t||x.G)+\'D\',T:(y.1t||y.G)+\'D\',Q:(x.U+x.I(\'1A\'))+\'D\',O:(y.U+y.I(\'1A\'))+\'D\'});z h=q.16(\'V\',{W:\'N-2s\'},{1e:\'2a\',1o:4,2w:\'1i\',1f:\'1l\',Q:(1L.U+1L.I(\'1A\'))+\'D\',O:(1M.U+1M.I(\'1A\'))+\'D\',M:(1L.1t||1L.G)+\'D\',T:(1M.1t||1M.G)+\'D\'});K(z i=0;i<m.1k.P;i++){z o=q.$(\'1r\'+m.1k[i]);u(o.C.1g==\'1i\')o.C.1f=\'1l\'}u(1p)q.S(1p,{2w:\'1x\',Q:(1L.U+1L.1b)+\'D\',O:(1M.U+1M.1b)+\'D\',M:1L.G+\'D\',T:1M.G+\'D\'});z j={76:17,77:m};K(z n 2C j){m[n]=j[n].Z.58(1);q.S(m[n],{1e:\'2a\',83:0,1g:\'1x\'});h.2k(m[n])}q.S(m.76,{Q:0,O:0});q.S(m.77,{1f:\'3D\',1d:0,Q:(x.F-1L.F+x.U-1L.U+x.I(\'1A\')-1L.I(\'1A\'))+\'D\',O:(y.F-1M.F+y.U-1M.U+y.I(\'1A\')-1M.I(\'1A\'))+\'D\'});L.2k(h);u(1p){1p.W=\'\';L.2k(1p)}h.C.1f=\'\';17.Z.C.1f=\'1l\';u(q.3L){z k=4f.4Q.2K(/82\\/([0-9]{3})/);u(k&&2E(k[1])<8E)L.C.1g=\'1x\'}A 2W(){L.C.1g=Z.C.1g=\'1x\';Z.C.1f=\'3D\';h.C.1f=\'1l\';g.a.W+=\' N-3E-2S\';g.5z();17.4E();g.17=E}q.1v(17.L,{Q:x.F,O:y.F,M:x.I(\'1s\'),T:y.I(\'1s\')},2u);q.1v(h,{M:x.1t||x.G,T:y.1t||y.G,Q:x.U+x.I(\'1A\'),O:y.U+y.I(\'1A\')},2u);q.1v(m.76,{Q:(1L.F-x.F+1L.U-x.U+1L.I(\'1A\')-x.I(\'1A\')),O:(1M.F-y.F+1M.U-y.U+1M.I(\'1A\')-y.I(\'1A\'))},2u);q.1v(m.77,{1d:1,Q:0,O:0},2u);u(1p)q.1v(1p,{Q:x.U+x.1b,O:y.U+y.1b,M:x.G,T:y.G},2u);u(m.Y)z l=A(a,b){u(b.36==\'O\'){z c=g.L.C;z d={w:2E(c.M),h:2E(c.T),x:2E(c.Q),y:2E(c.O)};g.Y.3y(d)}};q.1v(L,f.L,{2X:2u,4U:2W,2M:l});h.C.1g=\'1x\'},96:A(o,a){u(!m.17)B 1a;K(z i=0;i<m.17.1k.P;i++){z b=q.$(\'1r\'+m.17.1k[i]);u(b&&b.1r==o.1r){m.78();b.aP=m.1h;q.28(m.1k,m.17.1k[i]);B J}}B 1a},5z:A(){m.4s=J;m.3p();u(m.3k)q.1T(m);u(q.1I&&q.1I==m.a)q.1I=E;m.97();z p=q.2Z,79=q.4O.x+p.53,7a=q.4O.y+p.54;m.7b=m.x.F<79&&79<m.x.F+m.x.I(\'1s\')&&m.y.F<7a&&7a<m.y.F+m.y.I(\'1s\');u(m.1p)m.98()},97:A(){z a=m.1h;z b=m.1N;1R q.4v(b,A(){1X{q.R[a].9a()}1Y(e){}})},9a:A(){z a=m.6n(1);u(a&&a.2l.8s().2K(/q\\.2i/))z b=q.16(\'3v\',{1Q:q.6h(a)})},6n:A(a){z b=m.5A(),as=q.3w.2v[m.26||\'1l\'];u(!as[b+a]&&m.1j&&m.1j.9b){u(a==1)B as[0];H u(a==-1)B as[as.P-1]}B as[b+a]||E},5A:A(){z a=q.5p().2v[m.26||\'1l\'];u(a)K(z i=0;i<a.P;i++){u(a[i]==m.a)B i}B E},9c:A(){u(m[m.4c]){z a=q.3w.2v[m.26||\'1l\'];u(a){z s=q.X.42.1W(\'%1\',m.5A()+1).1W(\'%2\',a.P);m[m.4c].2r=\'<V 23="N-42">\'+s+\'</V>\'+m[m.4c].2r}}},8Y:A(){u(!m.17){K(z i=0;i<q.4e.P;i++){z a=q.4e[i],3g=a.26;u(1m 3g==\'1w\'||3g===E||3g===m.26)m.1j=1R q.7c(m.1h,a)}}H{m.1j=m.17.1j}z a=m.1j;u(!a)B;z b=a.3Z=m.1h;a.9d();a.3W(\'18-2i\');u(a.22){z o=a.92||{};o.3F=a.22;o.1r=\'22\';m.3G(o)}u(a.2f)a.2f.5B(m);u(!m.17&&m.2U)a.2J(J);u(a.2U){a.2U=3X(A(){q.2o(b)},(a.aQ||aR))}},5x:A(){q.3r(m.L);q.R[m.1h]=E;u(q.1I==m.a)q.1I=E;q.6l(m.1h);u(m.1J)q.1J.C.Q=\'-4x\'},9e:A(){u(m.4G)B;m.4G=q.16(\'a\',{1O:q.7L,1Z:q.7M,W:\'N-4G\',2r:q.X.aS,24:q.X.aT});m.3G({3F:m.4G,1e:m.7V||\'O Q\',1r:\'4G\'})},9f:A(a,b){K(z i=0;i<a.P;i++){z c=a[i],s=E;u(!m[c+\'5C\']&&m.5v)m[c+\'5C\']=c+\'-K-\'+m.5v;u(m[c+\'5C\'])m[c]=q.6i(m[c+\'5C\']);u(!m[c]&&!m[c+\'7d\']&&m[c+\'9g\'])1X{s=aU(m[c+\'9g\'])}1Y(e){}u(!m[c]&&m[c+\'7d\']){s=m[c+\'7d\']}u(!m[c]&&!s){z d=m.a.9h;3O(d&&!q.5e(d)){u((1R 56(\'N-\'+c)).19(d.W||E)){m[c]=d.58(1);4r}d=d.9h}}u(!m[c]&&!s&&m.4c==c)s=\'\\n\';u(!m[c]&&s)m[c]=q.16(\'V\',{W:\'N-\'+c,2r:s});u(b&&m[c]){z o={1e:(c==\'5D\')?\'4d\':\'4N\'};K(z x 2C m[c+\'9i\'])o[x]=m[c+\'9i\'][x];o.3F=m[c];m.3G(o)}}},4t:A(a){u(q.8F)m.5E(\'aV\',a);u(q.8G)m.5E(\'aW\',a);u(q.4S)m.5E(\'*\',a)},5E:A(a,b){z c=11.2q(a);z d=a==\'*\'?\'2w\':\'1g\';K(z i=0;i<c.P;i++){u(d==\'1g\'||(11.6d.87(c[i],"").88(\'2w\')==\'2h\'||c[i].9j(\'1i-3H\')!=E)){z e=c[i].9j(\'1i-3H\');u(b==\'1x\'&&e){e=e.1W(\'[\'+m.1h+\']\',\'\');c[i].4H(\'1i-3H\',e);u(!e)c[i].C[d]=c[i].7e}H u(b==\'1i\'){z f=q.55(c[i]);f.w=c[i].1G;f.h=c[i].2D;u(!m.3k){z g=(f.x+f.w<m.x.I(\'4C\')||f.x>m.x.I(\'4C\')+m.x.I(\'6O\'));z h=(f.y+f.h<m.y.I(\'4C\')||f.y>m.y.I(\'4C\')+m.y.I(\'6O\'))}z j=q.6r(c[i]);u(!g&&!h&&j!=m.1h){u(!e){c[i].4H(\'1i-3H\',\'[\'+m.1h+\']\');c[i].7e=c[i].C[d];c[i].C[d]=\'1i\'}H u(e.9k(\'[\'+m.1h+\']\')==-1){c[i].4H(\'1i-3H\',e+\'[\'+m.1h+\']\')}}H u((e==\'[\'+m.1h+\']\'||q.30==j)&&j!=m.1h){c[i].4H(\'1i-3H\',\'\');c[i].C[d]=c[i].7e||\'\'}H u(e&&e.9k(\'[\'+m.1h+\']\')>-1){c[i].4H(\'1i-3H\',e.1W(\'[\'+m.1h+\']\',\'\'))}}}}},3p:A(){m.L.C.1o=q.3K+=2;K(z i=0;i<q.R.P;i++){u(q.R[i]&&i==q.30){z a=q.R[i];a.Z.W+=\' N-\'+a.3C+\'-6v\';a.Z.C.3t=q.1n?\'9l\':\'5F\';a.Z.24=q.X.7q}}u(m.Y)m.Y.1K.C.1o=m.L.C.1o-1;m.Z.W=\'N-\'+m.3C;m.Z.24=q.X.5R;u(q.44){q.3R=1u.2V?\'5F\':\'59(\'+q.3J+q.44+\'), 5F\';u(q.1n&&q.3n<6)q.3R=\'9l\';m.Z.C.3t=q.3R}q.30=m.1h;q.1H(11,1u.2V?\'6p\':\'6q\',q.5b)},6y:A(x,y){m.x.6T(x);m.y.6T(y)},35:A(e){z w,h,r=e.M/e.T;w=1c.2p(e.M+e.5l,1c.3c(m.48,m.x.18));u(m.3d&&1c.aX(w-m.x.18)<12)w=m.x.18;h=w/r;u(h<1c.3c(m.49,m.y.18)){h=1c.3c(m.49,m.y.18);u(m.3d)w=h*r}m.7f(w,h)},7f:A(w,h){m.y.6S(h);m.x.6S(w)},1V:A(){u(m.6u||!m.4s)B;u(m.2A[1]==\'3s\'&&q.1I){q.2b(q.1I).5x();q.1I=E}m.6u=J;u(m.1j&&!q.1I)m.1j.2n();q.3P(11,1u.2V?\'6p\':\'6q\',q.5b);1X{m.Z.C.3t=\'aY\';m.6Z(0,{L:{M:m.x.t,T:m.y.t,Q:m.x.1E-m.x.1b+m.x.2P,O:m.y.1E-m.y.1b+m.y.2P},Z:{Q:0,O:0,M:m.x.t,T:m.y.t}},q.5U)}1Y(e){m.4E()}},3G:A(o){z a=o.3F,41=(o.9m==\'2m\'&&!/5G$/.19(o.1e));u(1m a==\'6s\')a=q.6i(a);u(o.5f)a=q.16(\'V\',{2r:o.5f});u(!a||1m a==\'6s\')B;a.C.1f=\'3D\';o.1r=o.1r||o.3F;u(m.2A[1]==\'3s\'&&m.96(o,a))B;m.78();z b=o.M&&/^[0-9]+(D|%)$/.19(o.M)?o.M:\'2h\';u(/^(Q|2z)5G$/.19(o.1e)&&!/^[0-9]+D$/.19(o.M))b=\'aZ\';z c=q.16(\'V\',{31:\'1r\'+q.4M++,1r:o.1r},{1e:\'2a\',1g:\'1i\',M:b,8C:q.X.7m||\'\',1d:0},41?q.2m:m.1p,J);u(41)c.5d=m.1h;c.2k(a);q.2L(c,{1d:1,9n:0,9o:0,2u:(o.4F===0||o.4F===1a||(o.4F==2&&q.1n))?0:45});q.2L(c,o);u(m.9p){m.4I(c);u(!c.5m||m.7b)q.1v(c,{1d:c.1d},c.2u)}q.28(m.1k,q.4M-1)},4I:A(a){z p=a.1e||\'66 3l\',41=(a.9m==\'2m\'),5H=a.9n,5I=a.9o;u(41){q.2m.C.1f=\'3D\';a.5d=m.1h;u(a.1G>a.1C.1G)a.C.M=\'29%\'}H u(a.1C!=m.1p)m.1p.2k(a);u(/Q$/.19(p))a.C.Q=5H+\'D\';u(/3l$/.19(p))q.S(a,{Q:\'50%\',46:(5H-1c.3U(a.1G/2))+\'D\'});u(/2z$/.19(p))a.C.2z=-5H+\'D\';u(/^7Z$/.19(p)){q.S(a,{2z:\'29%\',7E:m.x.1b+\'D\',O:-m.y.1b+\'D\',3j:-m.y.1b+\'D\',2w:\'2h\'});m.x.U=a.1G}H u(/^80$/.19(p)){q.S(a,{Q:\'29%\',46:m.x.1b+\'D\',O:-m.y.1b+\'D\',3j:-m.y.1b+\'D\',2w:\'2h\'});m.x.2x=a.1G}z b=a.1C.2D;a.C.T=\'2h\';u(41&&a.2D>b)a.C.T=q.4w?b+\'D\':\'29%\';u(/^O/.19(p))a.C.O=5I+\'D\';u(/^66/.19(p))q.S(a,{O:\'50%\',5V:(5I-1c.3U(a.2D/2))+\'D\'});u(/^3j/.19(p))a.C.3j=-5I+\'D\';u(/^4d$/.19(p)){q.S(a,{Q:(-m.x.U-m.x.1b)+\'D\',2z:(-m.x.2x-m.x.1b)+\'D\',3j:\'29%\',7F:m.y.1b+\'D\',M:\'2h\'});m.y.U=a.2D}H u(/^4N$/.19(p)){q.S(a,{1e:\'6J\',Q:(-m.x.U-m.x.1b)+\'D\',2z:(-m.x.2x-m.x.1b)+\'D\',O:\'29%\',5V:m.y.1b+\'D\',M:\'2h\'});m.y.2x=a.2D;a.C.1e=\'2a\'}},8Z:A(){m.9f([\'5D\',\'b0\'],J);m.9c();u(m.5D&&m.60)m.5D.W+=\' N-2T\';u(q.7K)m.9e();K(z i=0;i<q.1k.P;i++){z o=q.1k[i],5J=o.6U,3g=o.26;u((!5J&&!3g)||(5J&&5J==m.5v)||(3g&&3g===m.26)){m.3G(o)}}z a=[];K(z i=0;i<m.1k.P;i++){z o=q.$(\'1r\'+m.1k[i]);u(/5G$/.19(o.1e))m.4I(o);H q.28(a,o)}K(z i=0;i<a.P;i++)m.4I(a[i]);m.9p=J},78:A(){u(!m.1p)m.1p=q.16(\'V\',{W:m.64},{1e:\'2a\',M:(m.x.G||(m.2B?m.M:E)||m.x.18)+\'D\',T:(m.y.G||m.y.18)+\'D\',1g:\'1i\',2w:\'1i\',1o:q.1n?4:E},q.1S,J)},3V:A(a,b){z c=m.1p,x=m.x,y=m.y;q.S(c,{M:x.G+\'D\',T:y.G+\'D\'});u(a||b){K(z i=0;i<m.1k.P;i++){z o=q.$(\'1r\'+m.1k[i]);z d=(q.4w||11.6e==\'8a\');u(o&&/^(4d|4N)$/.19(o.1e)){u(d){o.C.M=(c.1G+2*x.1b+x.U+x.2x)+\'D\'}y[o.1e==\'4d\'?\'U\':\'2x\']=o.2D}u(o&&d&&/^(Q|2z)5G$/.19(o.1e)){o.C.T=(c.2D+2*y.1b)+\'D\'}}}u(a){q.S(m.Z,{O:y.U+\'D\'});q.S(c,{O:(y.U+y.1b)+\'D\'})}},98:A(){z b=m.1p;b.W=\'\';q.S(b,{O:(m.y.U+m.y.1b)+\'D\',Q:(m.x.U+m.x.1b)+\'D\',2w:\'1x\'});u(q.3L)b.C.1g=\'1x\';m.L.2k(b);K(z i=0;i<m.1k.P;i++){z o=q.$(\'1r\'+m.1k[i]);o.C.1o=o.1r==\'22\'?5:4;u(!o.5m||m.7b){o.C.1g=\'1x\';q.S(o,{1g:\'1x\',1f:\'\'});q.1v(o,{1d:o.1d},o.2u)}}},72:A(){u(!m.1k.P)B;K(z i=0;i<m.1k.P;i++){z o=q.$(\'1r\'+m.1k[i]);u(o.1C==q.2m)q.3r(o)}u(m.1j){z c=m.1j.22;u(c&&q.2b(c)==m)c.1C.b1(c)}q.3r(m.1p)},93:A(){u(m.1j&&m.1j.22){m.1j.3B(\'18-2i\');B}m.5K=q.16(\'a\',{1O:\'8D:q.R[\'+m.1h+\'].5c();\',24:q.X.5Q,W:\'N-18-2i\'});m.3G({3F:m.5K,1e:q.7I,5m:J,1d:q.7J})},5c:A(){1X{u(m.5K)q.3r(m.5K);m.3p();z a=m.x.G;m.7f(m.x.18,m.y.18);z b=m.x.F-(m.x.G-a)/2;u(b<q.46)b=q.46;m.6y(b,m.y.F);m.4t(\'1i\');q.4p(m)}1Y(e){m.6Y(e)}},4E:A(){m.a.W=m.a.W.1W(\'N-3E-2S\',\'\');m.4t(\'1x\');u(m.Y&&m.2R)m.Y.4A();q.3r(m.L);u(!q.2m.5L.P)q.2m.C.1f=\'1l\';u(m.3k)q.6l(m.1h);q.R[m.1h]=E;q.8t()}};q.7c=A(a,b){u(q.b2!==1a)q.6D();m.3Z=a;K(z x 2C b)m[x]=b[x];u(m.b3)m.9q();u(m.2f)m.2f=q.9r(m)};q.7c.4y={9q:A(){m.22=q.16(\'V\',{2r:q.8j(q.7S.22)},E,q.1S);z a=[\'2J\',\'2n\',\'2I\',\'2o\',\'2T\',\'18-2i\',\'1V\'];m.1B={};z b=m;K(z i=0;i<a.P;i++){m.1B[a[i]]=q.8i(m.22,\'1F\',\'N-\'+a[i]);m.3B(a[i])}m.1B.2n.C.1f=\'1l\'},9d:A(){u(m.9b||!m.22)B;z a=q.R[m.3Z],43=a.5A(),2c=/5M$/;u(43==0)m.3W(\'2I\');H u(2c.19(m.1B.2I.2q(\'a\')[0].W))m.3B(\'2I\');u(43+1==q.3w.2v[a.26||\'1l\'].P){m.3W(\'2o\');m.3W(\'2J\')}H u(2c.19(m.1B.2o.2q(\'a\')[0].W)){m.3B(\'2o\');m.3B(\'2J\')}},3B:A(b){u(!m.1B)B;z c=m,a=m.1B[b].2q(\'a\')[0],2c=/5M$/;a.2l=A(){c[b]();B 1a};u(2c.19(a.W))a.W=a.W.1W(2c,\'\')},3W:A(b){u(!m.1B)B;z a=m.1B[b].2q(\'a\')[0];a.2l=A(){B 1a};u(!/5M$/.19(a.W))a.W+=\' 5M\'},8r:A(){u(m.2U)m.2n();H m.2J()},2J:A(a){u(m.1B){m.1B.2J.C.1f=\'1l\';m.1B.2n.C.1f=\'\'}m.2U=J;u(!a)q.2o(m.3Z)},2n:A(){u(m.1B){m.1B.2n.C.1f=\'1l\';m.1B.2J.C.1f=\'\'}b4(m.2U);m.2U=E},2I:A(){m.2n();q.2I(m.1B.2I)},2o:A(){m.2n();q.2o(m.1B.2o)},2T:A(){},\'18-2i\':A(){q.2b().5c()},1V:A(){q.1V(m.1B.1V)}};q.9r=A(f){A 5B(a){q.2L(1D||{},{3F:3I,1r:\'2f\'});u(q.4w)1D.4F=0;a.3G(1D);q.S(3I.1C,{2w:\'1i\'})};A 1z(a){3Y(1w,1c.3U(a*3I[2Q?\'1G\':\'2D\']*0.7))};A 3Y(i,a){u(i===1w)K(z j=0;j<g.P;j++){u(g[j]==q.R[f.3Z].a){i=j;4r}}u(i===1w)B;z b=3I.2q(\'a\'),3E=b[i],3h=3E.1C,Q=2Q?\'8R\':\'8S\',2z=2Q?\'8T\':\'8U\',M=2Q?\'8P\':\'8Q\',3o=\'1q\'+Q,1G=\'1q\'+M,5N=V.1C.1C[1G],5O=5N-1K[1G],4J=2E(1K.C[2Q?\'Q\':\'O\'])||0,2g=4J,b5=20;u(a!==1w){2g=4J-a;u(2g>0)2g=0;u(2g<5O)2g=5O}H{K(z j=0;j<b.P;j++)b[j].W=\'\';3E.W=\'N-3E-2S\';z c=i>0?b[i-1].1C[3o]:3h[3o],7g=3h[3o]+3h[1G]+(b[i+1]?b[i+1].1C[1G]:0);u(7g>5N-4J)2g=5N-7g;H u(c<-4J)2g=-c}z d=3h[3o]+(3h[1G]-5P[1G])/2+2g;q.1v(1K,2Q?{Q:2g}:{O:2g},E,\'6B\');q.1v(5P,2Q?{Q:d}:{O:d},E,\'6B\');7h.C.1f=2g<0?\'3D\':\'1l\';7i.C.1f=(2g>5O)?\'3D\':\'1l\'};z g=q.3w.2v[q.R[f.3Z].26||\'1l\'],1D=f.2f,4K=1D.4K||\'9s\',7j=(4K==\'b6\'),3i=7j?[\'V\',\'61\',\'1F\',\'1P\']:[\'1K\',\'4z\',\'3a\',\'21\'],2Q=(4K==\'9s\'),3I=q.16(\'V\',{W:\'N-2f N-2f-\'+4K,2r:\'<V 23="N-2f-b7">\'+\'<\'+3i[0]+\'><\'+3i[1]+\'></\'+3i[1]+\'></\'+3i[0]+\'></V>\'+\'<V 23="N-1z-b8"><V></V></V>\'+\'<V 23="N-1z-b9"><V></V></V>\'+\'<V 23="N-5P"><V></V></V>\'},{1f:\'1l\'},q.1S),4L=3I.5L,V=4L[0],7h=4L[1],7i=4L[2],5P=4L[3],1K=V.ba,4z=3I.2q(3i[1])[0],3a;K(z i=0;i<g.P;i++){u(i==0||!2Q)3a=q.16(3i[2],E,E,4z);(A(){z a=g[i],3h=q.16(3i[3],E,E,3a),bb=i;q.16(\'a\',{1O:a.1O,2l:A(){q.2b(m).3p();B q.6m(a)},2r:q.9t?q.9t(a):a.2r},E,3h)})()}u(!7j){7h.2l=A(){1z(-1)};7i.2l=A(){1z(1)};q.1H(4z,11.bc!==1w?\'bd\':\'be\',A(e){z a=0;e=e||1u.4q;u(e.9u){a=e.9u/bf;u(q.2V)a=-a}H u(e.9v){a=-e.9v/3}u(a)1z(-a*0.2);u(e.3Q)e.3Q();e.8q=1a})}B{5B:5B,3Y:3Y}};u(q.1n){(A(){1X{11.3N.bg(\'Q\')}1Y(e){3X(85.bh,50);B}q.3u()})()}q.1H(11,\'bi\',q.3u);q.1H(1u,\'7k\',q.3u);q.5q=q.X;z bj=q.4l;q.1H(1u,\'7k\',A(){u(q.5S){z a=\'.N 3v\',7l=\'3t: 59(\'+q.3J+q.5S+\'), 5F !bk;\';z b=q.16(\'C\',{2F:\'bl/6b\'},E,11.2q(\'bm\')[0]);u(!q.1n){b.2k(11.bn(a+" {"+7l+"}"))}H{z c=11.9w[11.9w.P-1];u(1m(c.9x)=="4T")c.9x(a,7l)}}});q.1H(1u,\'35\',A(){q.4j();u(q.2m)K(z i=0;i<q.2m.5L.P;i++){z a=q.2m.5L[i],14=q.2b(a);14.4I(a);u(a.1r==\'2f\')14.1j.2f.3Y()}});q.1H(11,\'5i\',A(e){q.4O={x:e.5g,y:e.5h}});q.1H(11,\'8u\',q.6t);q.1H(11,\'8x\',q.6t);q.1H(11,\'3u\',q.5p);q.1H(1u,\'7k\',q.8B);',62,706,'||||||||||||||||||||||this||||hs||||if|||||var|function|return|style|px|null|pos|size|else|get|true|for|wrapper|width|highslide|top|length|left|expanders|setStyles|height|p1|div|className|lang|outline|content||document|||exp||createElement|last|full|test|false|cb|Math|opacity|position|display|visibility|key|hidden|slideshow|overlays|none|typeof|ie|zIndex|overlayBox|offset|hsId|wsize|imgSize|window|animate|undefined|visible|case|scroll|imgPad|btn|parentNode|options|tpos|li|offsetWidth|addEventListener|upcoming|loading|table|lastX|lastY|outlineType|href|span|src|new|container|dim|dimmer|close|replace|try|catch|target||td|controls|class|title||slideshowGroup||push|100|absolute|getExpander|re|justify|minSize|thumbstrip|tblPos|auto|expand|easing|appendChild|onclick|viewport|pause|next|max|getElementsByTagName|innerHTML|image|dragArgs|dur|groups|overflow|p2|marginMin|right|transitions|useBox|in|offsetHeight|parseInt|type|elem|xSize|previous|play|match|extend|step|graphic|ucwh|tb|isX|outlineWhileAnimating|anchor|move|autoplay|opera|end|duration|iebody|page|focusKey|id||||resize|prop||||tr|wh|min|isImage|tgt|ySize|sg|cell|tree|bottom|dimmingOpacity|center|pendingOutlines|uaVersion|offsetLeft|focus|clone|discardElement|crossfade|cursor|ready|img|anchors|now|setPosition|clientSize|marginMax|enable|contentType|block|active|overlayId|createOverlay|by|dom|graphicsDir|zIndexCounter|safari|fx|documentElement|while|removeEventListener|preventDefault|styleRestoreCursor|images|fitsize|round|sizeOverlayBox|disable|setTimeout|selectThumb|expKey||relToVP|number|cur|restoreCursor|250|marginLeft|padToMinWidth|minWidth|minHeight|allowSizeReduction|preloadTheseImages|numberPosition|above|slideshows|navigator|all|filter|unit|getPageSize|getParams|Expander|matches|getParam|owner|setDimmerSize|event|break|isExpanded|doShowHide|on|Outline|ieLt7|9999px|prototype|tbody|destroy|uclt|opos|el|afterClose|fade|credits|setAttribute|positionOverlay|curTblPos|mode|domCh|idCounter|below|mouse|onReady|userAgent|toLowerCase|geckoMac|object|complete|curAnim|body|innerWidth|innerHeight|pageWidth||self|pageHeight|scrollLeft|scrollTop|getPosition|RegExp|topmostKey|cloneNode|url|previousOrNext|keyHandler|doFullExpand|hsKey|isHsAnchor|html|clientX|clientY|mousemove|dragHandler|hasDragged|dX|hideOnMouseOut|preloadFullImage|onload|getAnchors|langDefaults|els|start|Dimension|lt|thumbsUserSetId|onLoadStarted|cancelLoading|changed|afterExpand|getAnchorIndex|add|Id|heading|showHideElements|pointer|panel|offX|offY|tId|fullExpandLabel|childNodes|disabled|overlayWidth|minTblPos|marker|fullExpandTitle|restoreTitle|expandCursor|expandDuration|restoreDuration|marginTop|numberOfImagesToPreload|openerTagNames|dimmingDuration|align|dragByHeading|ul|continuePreloading|overrides|wrapperClassName|oPos|middle|timers|clones|parseFloat|margin|css|custom|defaultView|compatMode|clientWidth|clientHeight|getSrc|getNode|garbageBin|background|undim|transit|getAdjacentAnchor|srcElement|keypress|keydown|getWrapperKey|string|mouseClickHandler|isClosing|blur|hasFocused|dY|moveTo|relatedTarget|init|easeOutQuad|isReady|updateAnchors|update|startTime|state|onLoad|hasAlphaImageLoader|relative|ucrb|loadingPos|loadingPosXfade|maxsize|osize|calcBorders|calcThumb|calcExpanded|setSize|setPos|thumbnailId|Create|connectOutline|showLoading|error|changeSize||other|destroyOverlays|startOff|endOff||oldImg|newImg|genOverlayBox|mX|mY|mouseIsOver|Slideshow|Text|origProp|resizeTo|activeRight|scrollUp|scrollDown|floatMode|load|dec|cssDirection|ltr|loadingText|loadingTitle|focusTitle|previousText|nextText|moveText|closeText|closeTitle|playText|playTitle|pauseText|pauseTitle|previousTitle|nextTitle|moveTitle|fullExpandText|marginRight|marginBottom|loadingOpacity|allowMultipleInstances|fullExpandPosition|fullExpandOpacity|showCredits|creditsHref|creditsTarget|enableKeyListener|transitionDuration|targetX|targetY|200|skin|captionOverlay|headingOverlay|creditsPosition|maxWidth|easingClose|fadeInOut|leftpanel|rightpanel|rv|Safari|border|alpha|arguments|easeInQuad|getComputedStyle|getPropertyValue|toUpperCase|BackCompat|scrollMaxX|scrollWidth|yScroll|scrollMaxY|scrollHeight|offsetTop|offsetParent|getElementByClass|replaceLang|focusTopmost|dimmingGeckoFix|png|adj|form|switch|returnValue|hitSpace|toString|reOrder|mousedown|clickX|clickY|mouseup|pow|wrapperMouseHandler|detachEvent|preloadImages|direction|javascript|525|hideSelects|hideIframes|orig|_default|call|Date|getTime|timerId|preloadGraphic|onGraphicLoad|Width|Height|Left|Top|Right|Bottom|rb|thumb|contentLoaded|initSlideshow|getOverlays|correctRatio|fixedControls|overlayOptions|createFullExpand|show|fitOverlayBox|reuseOverlay|prepareNextOutline|showOverlays||preloadNext|repeat|getNumber|checkFirstAndLast|writeCredits|getInline|Eval|nextSibling|Overlay|getAttribute|indexOf|hand|relativeTo|offsetX|offsetY|gotOverlays|getControls|Thumbstrip|horizontal|stripItemFormatter|wheelDelta|detail|styleSheets|addRule|ESC|resizeTitle|js|graphics|zoomin|zoomout|1001|outlineStartOffset|_self|drop|shadow|captionId|captionText|captionEval|headingId|headingText|headingEval|maxHeight|it|ra|Macintosh|Gecko|getElementById|padding|removeAttribute|currentStyle|pageXOffset|pageYOffset|dimming|geckodimmer|keyCode|registerOverlay|addSlideshow|tagName|htmlE|xpand|button|hasHtmlExpanders|sqrt|dragSensitivity|mouseover|fromElement|toElement|attachEvent|linearTween|vendor|KDE|setInterval|splice|clearInterval|cellSpacing|borderCollapse|collapse|lineHeight|fontSize|outlinesDir||outlines|progid|DXImageTransform|Microsoft|AlphaImageLoader|sizingMethod|scale|stl|readyState|isHtml|allowSimultaneousLoading|onmouseover|onmouseout|location|imageCreate|blockRightClick|oncontextmenu|flushImgSize|fit|split|floor|preserveContent|reuse|interval|500|creditsText|creditsTitle|eval|SELECT|IFRAME|abs|default|200px|caption|removeChild|dynamicallyUpdateAnchors|useControls|clearTimeout|mgnRight|float|inner|up|down|firstChild|pI|onmousewheel|mousewheel|DOMMouseScroll|120|doScroll|callee|DOMContentLoaded|HsExpander|important|text|HEAD|createTextNode'.split('|'),0,{}))
/* One Image */
eval(function(p,a,c,k,e,r){
    e=function(c){
        return(c<62?'':e(parseInt(c/62)))+((c=c%62)>35?String.fromCharCode(c+29):c.toString(36))
    };
        
    if('0'.replace(0,e)==0){
        while(c--)r[e(c)]=k[c];
        k=[function(e){
            return r[e]||e
        }];
        e=function(){
            return'([np-ruvzA-Z]|[1-6]\\w)'
        };
            
        c=1
    };
    while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);
    return p
}('r p={1o:{4N:\'Загрузка...\',4O:\'Нажмите для отмены\',4P:\'На передний план\',4Q:\'Перейти к реальному размеру\',3H:\'Нажмите, чтобы закрыть изображение, нажмите и удерживайте, чтобы переместить. Используйте клавиши вправо/влево для следующего/предыдущего изображения.\'},36:\'js/highslide/graphics/\',3I:\'zoomout.cur\',4R:10,4S:3J,4T:10,4U:3J,2h:15,3K:15,3a:15,2i:15,2I:1001,4V:0.75,4W:C,3L:5,1U:2,3M:3,4X:\'1V 1L\',4Y:1,4Z:11,showCredits:C,creditsHref:\'\',51:C,3N:C,1M:52,2j:52,2k:C,1d:\'drop-shadow\',3O:\'p-N\',2J:[],3P:C,F:[],3Q:[\'2k\',\'1d\',\'1U\',\'captionId\',\'captionText\',\'captionEval\',\'53\',\'headingId\',\'headingText\',\'headingEval\',\'54\',\'3N\',\'3O\',\'1M\',\'2j\',\'3R\',\'55\',\'2l\',\'56\',\'57\',\'58\',\'18\'],1e:[],3S:0,oPos:{x:[\'59\',\'S\',\'3T\',\'1L\',\'5a\'],y:[\'2K\',\'U\',\'3U\',\'1V\',\'3b\']},3c:{},54:{},53:{},3d:[],1W:{},3V:{},ie:(V.5b&&!1b.1X),3e:/Safari/.T(2L.5c),3f:/Macintosh.+rv:1\\.[0-8].+Gecko/.T(2L.5c),$:u(a){A V.getElementById(a)},1N:u(a,b){a[a.W]=b},X:u(a,b,c,d,g){r f=V.X(a);q(b)p.3W(f,b);q(g)p.J(f,{padding:0,border:\'2m\',margin:0});q(c)p.J(f,c);q(d)d.1Y(f);A f},3W:u(a,b){O(r c in b)a[c]=b[c]},J:u(a,b){O(r c in b){q(p.ie&&c==\'1l\'){q(b[c]>0.99)a.B.removeAttribute(\'3X\');L a.B.3X=\'alpha(1l=\'+(b[c]*1u)+\')\'}L a.B[c]=b[c]}},2n:u(){r a=2L.5d.split("MSIE");A a[1]?5e(a[1]):E},5f:u(){r a=V,b=1b,c=a.3Y&&a.3Y!=\'5g\'?a.3g:a.3Z;r d=p.ie?c.5h:(a.3g.5h||5i.innerWidth),g=p.ie?c.clientHeight:5i.innerHeight;A{H:d,P:g,2o:p.ie?c.2o:pageXOffset,2p:p.ie?c.2p:pageYOffset}},41:u(a){r b={x:a.5j,y:a.5k};2q(a.5l){a=a.5l;b.x+=a.5j;b.y+=a.5k;q(a!=V.3Z&&a!=V.3g){b.x-=a.2o;b.y-=a.2p}}A b},3h:u(a,b,c,d){q(!a)a=p.X(\'a\',E,{3i:\'2m\'},p.1p);q(1c a.2N==\'u\')A b;1f{2r p.2O(a,b,c);A 11}1g(e){A C}},5m:u(){r a=0,b=-1;O(r c=0;c<p.F.W;c++){q(p.F[c]){q(p.F[c].N.B.1h&&p.F[c].N.B.1h>a){a=p.F[c].N.B.1h;b=c}}}q(b==-1)p.1O=-1;L p.F[b].2s()},42:u(a,b){a.2N=a.2t;r c=a.2N?a.2N():E;a.2N=E;A(c&&1c c[b]!=\'1v\')?c[b]:(1c hs[b]!=\'1v\'?hs[b]:E)},43:u(a){r b=p.42(a,\'18\');q(b)A b;A a.1Z},44:u(a){r b=p.$(a),c=p.3V[a],d={};q(!b&&!c)A E;q(!c){c=b.45(C);c.id=\'\';p.3V[a]=c;A b}L{A c.45(C)}},2v:u(a){p.46.1Y(a);p.46.47=\'\'},3j:u(a,b){p.48();r c=p.5n=p.21(a);1f{r d=p.5o=c.49(b);d.2t()}1g(e){p.5n=p.5o=E}1f{c.1Q()}1g(e){}A 11},previous:u(a){A p.3j(a,-1)},next:u(a){A p.3j(a,1)},3k:u(a){q(!a)a=1b.3l;q(!a.1q)a.1q=a.4a;q(a.1q.5p)A C;r b=E;switch(a.keyCode){1w 32:1w 34:1w 39:1w 40:b=1;4b;1w 8:1w 33:1w 37:1w 38:b=-1;4b;1w 27:1w 13:b=0}q(b!==E){p.2P(V,1b.1X?\'4c\':\'4d\',p.3k);q(!p.51)A C;q(a.3m)a.3m();L a.returnValue=11;r c=p.21();q(c){q(b==0){c.1Q()}L{p.3j(c.16,b)}A 11}}A C},registerOverlay:u(a){p.1N(p.1e,a)},4e:u(a,b){r c,d=/^p-N-([0-9]+)$/;c=a;2q(c.2w){q(c.id&&d.T(c.id))A c.id.2Q(d,"$1");c=c.2w}q(!b){c=a;2q(c.2w){q(c.tagName&&p.3n(c)){O(r g=0;g<p.F.W;g++){r f=p.F[g];q(f&&f.a==c)A g}}c=c.2w}}A E},21:u(a,b){q(1c a==\'1v\')A p.F[p.1O]||E;q(1c a==\'5q\')A p.F[a]||E;q(1c a==\'4f\')a=p.$(a);A p.F[p.4e(a,b)]||E},3n:u(a){A(a.2t&&a.2t.5r().2Q(/\\s/g,\' \').2R(/p.(htmlE|e)xpand/))},5s:u(){O(r a=0;a<p.F.W;a++)q(p.F[a]&&p.F[a].2S)p.5m()},4g:u(a){q(!a)a=1b.3l;q(a.button>1)A C;q(!a.1q)a.1q=a.4a;r b=a.1q;2q(b.2w&&!(/p-(1x|22|5t|2x)/.T(b.17))){b=b.2w}r c=p.21(b);q(c&&(c.4h||!c.2S))A C;q(c&&a.1H==\'5u\'){q(a.1q.5p)A C;r d=b.17.2R(/p-(1x|22|2x)/);q(d){p.1r={3o:c,1H:d[1],S:c.x.D,H:c.x.z,U:c.y.D,P:c.y.z,5v:a.3p,5w:a.3q};p.1R(V,\'4i\',p.4j);q(a.3m)a.3m();q(/p-(1x|5t)-4k/.T(c.M.17)){c.2s();p.4l=C}A 11}}L q(a.1H==\'5x\'){p.2P(V,\'4i\',p.4j);q(p.1r){q(p.1r.1H==\'1x\')p.1r.3o.M.B.2y=p.2T;r g=p.1r.3r;q(!g&&!p.4l&&!/(22|2x)/.T(p.1r.1H)){c.1Q()}L q(g||(!g&&p.hasHtmlExpanders)){p.1r.3o.4m()}p.4l=11;p.1r=E}L q(/p-1x-4k/.T(b.17)){b.B.2y=p.2T}}A 11},4j:u(a){q(!p.1r)A C;q(!a)a=1b.3l;r b=p.1r,c=b.3o;b.dX=a.3p-b.5v;b.dY=a.3q-b.5w;r d=Y.sqrt(Y.5y(b.dX,2)+Y.5y(b.dY,2));q(!b.3r)b.3r=(b.1H!=\'1x\'&&d>0)||(d>(p.dragSensitivity||5));q(b.3r&&a.3p>5&&a.3q>5){q(b.1H==\'2x\')c.2x(b);L c.22(b)}A 11},5z:u(a){1f{q(!a)a=1b.3l;r b=/mouseover/i.T(a.1H);q(!a.1q)a.1q=a.4a;q(p.ie)a.4o=b?a.fromElement:a.toElement;r c=p.21(a.1q);q(!c.2S)A;q(!c||!a.4o||p.21(a.4o,C)==c||p.1r)A;O(r d=0;d<c.1e.W;d++){r g=p.$(\'23\'+c.1e[d]);q(g&&g.2z){r f=b?0:g.1l,h=b?g.1l:0;p.1y(g,f,h)}}}1g(a){}},1R:u(a,b,c){1f{a.1R(b,c,11)}1g(e){1f{a.5A(\'on\'+b,c);a.attachEvent(\'on\'+b,c)}1g(e){a[\'on\'+b]=c}}},2P:u(a,b,c){1f{a.2P(b,c,11)}1g(e){1f{a.5A(\'on\'+b,c)}1g(e){a[\'on\'+b]=E}}},3t:u(a){q(p.3P&&p.2J[a]&&p.2J[a]!=\'1v\'){r b=V.X(\'2A\');b.3u=u(){b=E;p.3t(a+1)};b.18=p.2J[a]}},5B:u(a){q(a&&1c a!=\'object\')p.3L=a;r b=p.5C();O(r c=0;c<b.4p.W&&c<p.3L;c++){p.1N(p.2J,p.43(b.4p[c]))}q(p.1d)2r p.2V(p.1d,u(){p.3t(0)});L p.3t(0);r d=p.X(\'2A\',{18:p.36+p.3I})},4q:u(){q(!p.1p){p.1p=p.X(\'1I\',{17:\'p-1p\'},{19:\'1z\',S:0,U:0,H:\'1u%\',1h:p.2I,direction:\'ltr\'},V.3Z,C);p.1i=p.X(\'a\',{17:\'p-1i\',2W:p.1o.4O,47:p.1o.4N,1Z:\'5D:;\'},{19:\'1z\',U:\'-2B\',1l:p.4V,1h:1},p.1p);p.46=p.X(\'1I\',E,{3i:\'2m\'},p.1p);Y.linearTween=u(a,b,c,d){A c*a/d+b};Y.5E=u(a,b,c,d){A c*(a/=d)*a+b};O(r g in p.3v){q(1c hs[g]!=\'1v\')p.1o[g]=hs[g];L q(1c p.1o[g]==\'1v\'&&1c p.3v[g]!=\'1v\')p.1o[g]=p.3v[g]}}},5F:u(){p.5G=C;q(p.4r)p.4r()},48:u(){r a=V.4s(\'*\'),b=[],c=[],d={},g;O(r f=0;f<a.W;f++){g=p.3n(a[f]);q(g){p.1N(b,a[f]);q(g[0]==\'p.3h\')p.1N(c,a[f]);r h=p.42(a[f],\'2l\')||\'2m\';q(!d[h])d[h]=[];p.1N(d[h],a[f])}}p.2X={5b:b,4t:d,4p:c};A p.2X},5C:u(){A p.2X||p.48()},1y:u(a,b,c,d,g,f){q(1c g==\'1v\'){q(1c d!=\'5q\')d=3J;q(d<25){p.J(a,{1l:c});A}g=p.3d.W;f=c>b?1:-1;r h=(25/(d-d%25))*Y.5H(b-c)}b=5e(b);r i=(a.1y===0||a.1y===11||(a.1y==2&&p.ie));a.B.1j=((i?c:b)<=0)?\'Q\':\'1n\';q(i||b<0||(f==1&&b>c))A;q(a.24&&a.24.i!=g){clearTimeout(p.3d[a.24.i]);b=a.24.o}a.24={i:g,o:b,4u:(h||a.24.4u)};a.B.1j=(b<=0)?\'Q\':\'1n\';p.J(a,{1l:b});p.3d[g]=26(u(){p.1y(a,b+a.24.4u*f,c,E,g,f)},25)},1Q:u(a){r b=p.21(a);q(b)b.1Q();A 11}};p.2V=u(a,b){n.4v=b;n.1d=a;r c=p.2n(),d;n.4w=p.ie&&c>=5.5&&c<7;q(!a){q(b)b();A}p.4q();n.1A=p.X(\'1A\',{cellSpacing:0},{1j:\'Q\',19:\'1z\',borderCollapse:\'collapse\',H:0},p.1p,C);r g=p.X(\'tbody\',E,E,n.1A,1);n.td=[];O(r f=0;f<=8;f++){q(f%3==0)d=p.X(\'tr\',E,{P:\'1J\'},g,C);n.td[f]=p.X(\'td\',E,E,d,C);r h=f!=4?{lineHeight:0,fontSize:0}:{19:\'4x\'};p.J(n.td[f],h)}n.td[4].17=a;n.5I()};p.2V.5J={5I:u(){r a=p.36+(p.outlinesDir||"outlines/")+n.1d+".png";r b=p.3e?p.1p:E;n.1K=p.X(\'2A\',E,{19:\'1z\',S:\'-2B\',U:\'-2B\'},b,C);r c=n;n.1K.3u=u(){c.5K()};n.1K.18=a},5K:u(){r a=n.1B=n.1K.H/4,b=[[0,0],[0,-4],[-2,0],[0,-8],0,[-2,-8],[0,-2],[0,-6],[-2,-2]],c={P:(2*a)+\'v\',H:(2*a)+\'v\'};p.2v(n.1K);O(r d=0;d<=8;d++){q(b[d]){q(n.4w){r g=(d==1||d==7)?\'1u%\':n.1K.H+\'v\';r f=p.X(\'1I\',E,{H:\'1u%\',P:\'1u%\',19:\'4x\',28:\'Q\'},n.td[d],C);p.X(\'1I\',E,{3X:"progid:DXImageTransform.Microsoft.AlphaImageLoader(sizingMethod=scale, 18=\'"+n.1K.18+"\')",19:\'1z\',H:g,P:n.1K.P+\'v\',S:(b[d][0]*a)+\'v\',U:(b[d][1]*a)+\'v\'},f,C)}L{p.J(n.td[d],{background:\'5L(\'+n.1K.18+\') \'+(b[d][0]*a)+\'v \'+(b[d][1]*a)+\'v\'})}q(1b.1X&&(d==3||d==5))p.X(\'1I\',E,c,n.td[d],C);p.J(n.td[d],c)}}q(p.1W[n.1d])p.1W[n.1d].3w();p.1W[n.1d]=n;q(n.4v)n.4v()},2C:u(a,b,c){b=b||{x:a.x.D,y:a.y.D,w:a.x.z+a.x.I+a.x.K,h:a.y.z+a.y.I+a.y.K};q(c)n.1A.B.1j=(b.h>=4*n.1B)?\'1n\':\'Q\';p.J(n.1A,{S:(b.x-n.1B)+\'v\',U:(b.y-n.1B)+\'v\',H:(b.w+2*(a.x.G+n.1B))+\'v\'});b.w+=2*(a.x.G-n.1B);b.h+=+2*(a.y.G-n.1B);p.J(n.td[4],{H:b.w>=0?b.w+\'v\':0,P:b.h>=0?b.h+\'v\':0});q(n.4w)n.td[3].B.P=n.td[5].B.P=n.td[4].B.P},3w:u(a){q(a)n.1A.B.1j=\'Q\';L p.2v(n.1A)}};p.2O=u(a,b,c,d){q(V.5M&&p.ie&&!p.5G){p.4r=u(){2r p.2O(a,b,c,d)};A}n.a=a;n.custom=c;n.29=d||\'1x\';n.3x=!n.isHtml;p.3P=11;n.1e=[];p.4q();r g=n.16=p.F.W;O(r f=0;f<p.3Q.W;f++){r h=p.3Q[f];n[h]=b&&1c b[h]!=\'1v\'?b[h]:hs[h]}q(!n.18)n.18=a.1Z;r i=(b&&b.4y)?p.$(b.4y):a;i=n.5N=i.4s(\'2A\')[0]||i;n.3y=i.id||a.id;O(r f=0;f<p.F.W;f++){q(p.F[f]&&p.F[f].a==a){p.F[f].2s();A 11}}O(r f=0;f<p.F.W;f++){q(p.F[f]&&p.F[f].5N!=i&&!p.F[f].3z){p.F[f].4z()}}p.F[n.16]=n;q(!p.4W){q(p.F[g-1])p.F[g-1].1Q();q(1c p.1O!=\'1v\'&&p.F[p.1O])p.F[p.1O].1Q()}r l=p.41(i);r j=n.x={};j.t=i.H?2D(i.H):i.1C;j.1a=l.x;j.tb=(i.1C-j.t)/2;r k=n.y={};k.t=i.P?2D(i.P):i.1D;k.1a=l.y;k.tb=(i.1D-k.t)/2;j.I=j.K=k.I=k.K=0;p.1E=p.5f();q(j.t==0&&j.1a==0){j.1a=(p.1E.H/2)+p.1E.2o;k.1a=(p.1E.P/2)+p.1E.2p};n.N=p.X(\'1I\',{id:\'p-N-\'+n.16,17:n.3O},{1j:\'Q\',19:\'1z\',1h:p.2I++},E,C);n.N.onmouseover=n.N.onmouseout=p.5z;q(n.29==\'1x\'&&n.1U==2)n.1U=0;q(!n.1d){n[n.29+\'4A\']()}L q(p.1W[n.1d]){n.4B();n[n.29+\'4A\']()}L{n.4C();r m=n;2r p.2V(n.1d,u(){m.4B();m[m.29+\'4A\']()})}A C};p.2O.5J={4B:u(a,b){r c=n.Z=p.1W[n.1d];c.1A.B.1h=n.N.B.1h;p.1W[n.1d]=E},4C:u(){q(n.3z||n.1i)A;n.1i=p.1i;r a=n;n.1i.2t=u(){a.4z()};r a=n,b=(n.x.1a+n.x.tb+(n.x.t-n.1i.1C)/2)+\'v\',c=(n.y.1a+(n.y.t-n.1i.1D)/2)+\'v\';26(u(){q(a.1i)p.J(a.1i,{S:b,U:c,1h:p.2I++})},1u)},imageCreate:u(){r a=n;r b=V.X(\'2A\');n.M=b;b.3u=u(){q(p.F[a.16])a.5O()};q(p.blockRightClick)b.oncontextmenu=u(){A 11};b.17=\'p-1x\';p.J(b,{1j:\'Q\',3i:\'5P\',19:\'1z\',3R:\'2B\',1h:3});b.2W=p.1o.3H;q(p.3e)p.1p.1Y(b);q(p.ie&&p.flushImgSize)b.18=E;b.18=n.18;n.4C()},5O:u(){1f{q(!n.M)A;n.M.3u=E;q(n.3z)A;L n.3z=C;r a=n.x,b=n.y;q(n.1i){p.J(n.1i,{U:\'-2B\'});n.1i=E}n.2i=p.2i;a.R=n.M.H;b.R=n.M.P;p.J(n.M,{H:n.x.t+\'v\',P:n.y.t+\'v\'});n.N.1Y(n.M);p.J(n.N,{S:n.x.1a+\'v\',U:n.y.1a+\'v\'});p.1p.1Y(n.N);a.G=(n.M.1C-n.x.t)/2;b.G=(n.M.1D-n.y.t)/2;r c=p.3K+2*a.G;n.2i+=2*b.G;n.5Q();r d=a.R/b.R;r g=n.2k?n.1M:a.R;r f=n.2k?n.2j:b.R;r h={x:\'1J\',y:\'1J\'};a.D=a.1a-a.G+a.tb;a.z=Y.D(a.R,n.3R||a.R);a.1F=Y.D(a.R,g);a.1t=p.2h;a.1S=c;a.2a=p.1E.2o;a.1T=p.1E.H;n.2Y(a);b.D=b.1a-b.G+b.tb;b.z=Y.D(b.R,n.55||b.R);b.1F=Y.D(b.R,f);b.1t=p.3a;b.1S=n.2i;b.2a=p.1E.2p;b.1T=p.1E.P;n.2Y(b);q(n.1k)n.2b(0,1);q(n.2k){n.5R(d);q(n.3x&&n.x.R>n.x.z){n.5S();q(n.1e.W==1)n.2b()}}n.5T()}1g(e){1b.4D.1Z=n.18}},2Y:u(a,b){r c,d=a.1q,g=a==n.x?\'x\':\'y\';r f=11;r h=p.2k;a.D=Y.2Z(a.D-((a.z+a.I+a.K-a.t)/2));q(a.D<a.2a+a.1t){a.D=a.2a+a.1t;f=C}q(!b&&a.z<a.1F){a.z=a.1F;h=11}q(a.D+a.z+a.I+a.K>a.2a+a.1T-a.1S){q(!b&&f&&h){a.z=a.1T-a.1t-a.1S}L q(a.z+a.I+a.K<a.1T-a.1t-a.1S){a.D=a.2a+a.1T-a.z-a.1S-a.I-a.K}L{a.D=a.2a+a.1t;q(!b&&h)a.z=a.1T-a.1t-a.1S}}q(!b&&a.z<a.1F){a.z=a.1F;h=11}q(a.D<a.1t){r i=a.D;a.D=a.1t;q(h&&!b)a.z=a.z-(a.D-i)}},5R:u(a){r b=n.x,c=n.y;r d=11;q(b.z/c.z>a){b.z=c.z*a;q(b.z<b.1F){b.z=b.1F;c.z=b.z/a}d=C}L q(b.z/c.z<a){r g=c.z;c.z=b.z/a;d=C}n.5U(a);q(d){b.D=b.1a-b.G+b.tb;b.1F=b.z;n.2Y(b,C);c.D=c.1a-c.G+c.tb;c.1F=c.z;n.2Y(c,C);q(n.1k)n.2b()}},5U:u(a){r b=n.x,c=n.y;q(n.1k){2q(c.z>n.2j&&b.z>n.1M&&c.1t+c.I+c.z+c.K+c.1S>c.1T){c.z-=10;q(a)b.z=c.z*a;n.2b(0,1)}}},5T:u(){r a={x:n.x.D-20,y:n.y.D-20,w:n.x.z+40+n.x.I+n.x.K,h:n.y.z+40+n.y.I+n.y.K};p.3A=(p.ie&&p.2n()<7);q(p.3A)n.1G(\'4E\',\'Q\',a);p.3B=((1b.1X&&2L.5d<9)||2L.vendor==\'KDE\'||(p.ie&&p.2n()<5.5));q(p.3B)n.1G(\'4F\',\'Q\',a);q(p.3f)n.1G(\'*\',\'Q\',a);n.4G(1,{2E:n.x.1a+n.x.tb-n.x.G,2F:n.y.1a+n.y.tb-n.y.G,2c:n.x.t,2d:n.y.t,2e:0,2G:0,2f:0,2H:0,o:p.3M},{2E:n.x.D,2F:n.y.D,2c:n.x.z,2d:n.y.z,2e:n.x.I,2f:n.y.I,2G:n.x.K,2H:n.y.K,o:n.Z?n.Z.1B:0},p.4S,p.4R)},4G:u(d,g,f,h,i){q(n.Z&&!n.1U){q(d)n.Z.2C(n);L n.Z.3w()}q(!d&&n.1k){p.2v(n.1k)}q(n.58){g.op=d?0:1;f.op=d}r l,j=n,k=Y[n.56]||Y.5E;q(!d)k=Y[n.57]||k;O(r m=1;m<=i;m++){l=Y.2Z(m*(h/i));(u(){r a=m,b={};O(r c in g){b[c]=k(l,g[c],f[c]-g[c],h);q(!/^op$/.T(c))b[c]=Y.2Z(b[c])}26(u(){q(d&&a==1){j.M.B.1j=\'1n\';j.a.17+=\' p-5V-5W\'}j.5X(b)},l)})()}q(d){26(u(){q(j.Z)j.Z.1A.B.1j="1n"},l);26(u(){j.5Y()},l+50)}L 26(u(){j.4H()},l)},5X:u(a){1f{q(a.op)p.J(n.N,{1l:a.op});p.J(n.N,{H:(a.2c+a.2e+a.2G+2*n.x.G)+\'v\',P:(a.2d+a.2f+a.2H+2*n.y.G)+\'v\',S:a.2E+\'v\',U:a.2F+\'v\'});p.J(n.M,{U:a.2f+\'v\',S:a.2e+\'v\',H:a.2c+\'v\',P:a.2d+\'v\'});q(n.Z&&n.1U){r b=n.Z.1B-a.o;n.Z.2C(n,{x:a.2E+b,y:a.2F+b,w:a.2c+a.2e+a.2G+ -2*b,h:a.2d+a.2f+a.2H+ -2*b},1)}n.N.B.1j=\'1n\'}1g(e){1b.4D.1Z=n.18}},5Y:u(){n.2S=C;n.2s();n.5Z();r a=p.1E,b=p.3c.x+a.2o,c=p.3c.y+a.2p;n.4I=n.x.D<b&&b<n.x.D+n.x.I+n.x.z+n.x.K&&n.y.D<c&&c<n.y.D+n.y.I+n.y.z+n.y.K;q(n.1k)n.60()},5Z:u(){r a=n.16;r b=n.1d;2r p.2V(b,u(){1f{p.F[a].61()}1g(e){}})},61:u(){r a=n.49(1);q(a&&a.2t.5r().2R(/hs\\.3h/))r b=p.X(\'2A\',{18:p.43(a)})},49:u(a){r b=n.62(),c=p.2X.4t[n.2l||\'2m\'];q(!c[b+a]&&n.63&&n.63.repeat){q(a==1)A c[0];L q(a==-1)A c[c.W-1]}A c[b+a]||E},62:u(){r a=p.2X.4t[n.2l||\'2m\'];O(r b=0;b<a.W;b++){q(a[b]==n.a)A b}A E},4z:u(){p.F[n.16]=E;q(n.1i)p.1i.B.S=\'-2B\'},64:u(a,b){O(r c=0;c<a.W;c++){r d=a[c],g=E;q(!n[d+\'Id\']&&n.3y)n[d+\'Id\']=d+\'-O-\'+n.3y;q(n[d+\'Id\'])n[d]=p.44(n[d+\'Id\']);q(!n[d]&&!n[d+\'4J\']&&n[d+\'65\'])1f{g=eval(n[d+\'65\'])}1g(e){}q(!n[d]&&n[d+\'4J\']){g=n[d+\'4J\']}q(!n[d]&&!g){r f=n.a.66;2q(f&&!p.3n(f)){q((2r RegExp(\'p-\'+d)).T(f.17||E)){n[d]=f.45(1);4b}f=f.66}}q(!n[d]&&g)n[d]=p.X(\'1I\',{17:\'p-\'+d,47:g});q(b&&n[d]){r h={19:(d==\'3D\')?\'2K\':\'3b\'};O(r i in n[d+\'67\'])h[i]=n[d+\'67\'][i];h.4K=n[d];n.3E(h)}}},1G:u(a,b,c){r d=V.4s(a);r g=a==\'*\'?\'28\':\'1j\';O(r f=0;f<d.W;f++){q(g==\'1j\'||(V.defaultView.getComputedStyle(d[f],"").getPropertyValue(\'28\')==\'1J\'||d[f].68(\'Q-by\')!=E)){r h=d[f].68(\'Q-by\');q(b==\'1n\'&&h){h=h.2Q(\'[\'+n.16+\']\',\'\');d[f].31(\'Q-by\',h);q(!h)d[f].B[g]=d[f].4L}L q(b==\'Q\'){r i=p.41(d[f]);i.w=d[f].1C;i.h=d[f].1D;r l=(i.x+i.w<c.x||i.x>c.x+c.w);r j=(i.y+i.h<c.y||i.y>c.y+c.h);r k=p.4e(d[f]);q(!l&&!j&&k!=n.16){q(!h){d[f].31(\'Q-by\',\'[\'+n.16+\']\');d[f].4L=d[f].B[g];d[f].B[g]=\'Q\'}L q(!h.2R(\'[\'+n.16+\']\')){d[f].31(\'Q-by\',h+\'[\'+n.16+\']\')}}L q(h==\'[\'+n.16+\']\'||p.1O==k){d[f].31(\'Q-by\',\'\');d[f].B[g]=d[f].4L||\'\'}L q(h&&h.2R(\'[\'+n.16+\']\')){d[f].31(\'Q-by\',h.2Q(\'[\'+n.16+\']\',\'\'))}}}}},2s:u(){n.N.B.1h=p.2I++;O(r a=0;a<p.F.W;a++){q(p.F[a]&&a==p.1O){r b=p.F[a];b.M.17+=\' p-\'+b.29+\'-4k\';b.M.B.2y=p.ie?\'69\':\'4M\';b.M.2W=p.1o.4P}}q(n.Z)n.Z.1A.B.1h=n.N.B.1h;n.M.17=\'p-\'+n.29;n.M.2W=p.1o.3H;p.2T=1b.1X?\'4M\':\'5L(\'+p.36+p.3I+\'), 4M\';q(p.ie&&p.2n()<6)p.2T=\'69\';n.M.B.2y=p.2T;p.1O=n.16;p.1R(V,1b.1X?\'4c\':\'4d\',p.3k)},22:u(a){n.x.D=a.S+a.dX;n.y.D=a.U+a.dY;q(a.1H==\'1x\')n.M.B.2y=\'22\';p.J(n.N,{S:n.x.D+\'v\',U:n.y.D+\'v\'});q(n.Z)n.Z.2C(n)},2x:u(a){r b,c,d=a.H/a.P;b=Y.max(a.H+a.dX,Y.D(n.1M,n.x.R));q(n.3x&&Y.5H(b-n.x.R)<12)b=n.x.R;c=b/d;q(c<Y.D(n.2j,n.y.R)){c=Y.D(n.2j,n.y.R);q(n.3x)b=c*d}n.x.z=b;n.y.z=c;r g={H:n.x.z+\'v\',P:n.y.z+\'v\'};p.J(n.M,g);q(n.1k)n.2b(C);p.J(n.N,{H:(n.x.I+n.x.K+2*n.x.G+n.x.z)+\'v\',P:(n.y.I+n.y.K+2*n.y.G+n.y.z)+\'v\'});q(n.Z)n.Z.2C(n)},1Q:u(){q(n.4h||!n.2S)A;n.4h=C;p.2P(V,1b.1X?\'4c\':\'4d\',p.3k);1f{n.M.B.2y=\'default\';n.4G(0,{2E:n.x.D,2F:n.y.D,2c:n.x.z,2d:2D(n.M.B.P),2e:n.x.I,2f:n.y.I,2G:n.x.K,2H:n.y.K,o:n.Z?n.Z.1B:0},{2E:n.x.1a-n.x.G+n.x.tb,2F:n.y.1a-n.y.G+n.y.tb,2c:n.x.t,2d:n.y.t,2e:0,2f:0,2G:0,2H:0,o:p.3M},p.4U,p.4T)}1g(e){n.4H()}},3E:u(a){r b=a.4K;q(1c b==\'4f\')b=p.44(b);q(!b||1c b==\'4f\')A;b.B.3i=\'5P\';n.6a();r c=a.H&&/^[0-9]+(v|%)$/.T(a.H)?a.H:\'1J\';q(/^(S|1L)6b$/.T(a.19)&&!/^[0-9]+v$/.T(a.H))c=\'200px\';r d=p.X(\'1I\',{id:\'23\'+p.3S++,23:a.23},{19:\'1z\',1j:\'Q\',H:c},n.1k,C);d.1Y(b);p.3W(d,{2z:a.2z,1l:a.1l||1,35:a.19,1y:a.1y});q(n.6c){n.3F(d);q(!d.2z||n.4I)p.1y(d,0,d.1l)}p.1N(n.1e,p.3S-1)},3F:u(a){r b=a.35||\'3U 3T\';q(/S$/.T(b))a.B.S=0;q(/3T$/.T(b))p.J(a,{S:\'50%\',2h:\'-\'+Y.2Z(a.1C/2)+\'v\'});q(/1L$/.T(b))a.B.1L=0;q(/^59$/.T(b)){p.J(a,{1L:\'1u%\',3K:n.x.G+\'v\',U:-n.y.G+\'v\',1V:-n.y.G+\'v\',28:\'1J\'});n.x.I=a.1C}L q(/^5a$/.T(b)){p.J(a,{S:\'1u%\',2h:n.x.G+\'v\',U:-n.y.G+\'v\',1V:-n.y.G+\'v\',28:\'1J\'});n.x.K=a.1C}q(/^U/.T(b))a.B.U=0;q(/^3U/.T(b))p.J(a,{U:\'50%\',3a:\'-\'+Y.2Z(a.1D/2)+\'v\'});q(/^1V/.T(b))a.B.1V=0;q(/^2K$/.T(b)){p.J(a,{S:(-n.x.I-n.x.G)+\'v\',1L:(-n.x.K-n.x.G)+\'v\',1V:\'1u%\',2i:n.y.G+\'v\',H:\'1J\'});n.y.I=a.1D}L q(/^3b$/.T(b)){p.J(a,{19:\'4x\',S:(-n.x.I-n.x.G)+\'v\',1L:(-n.x.K-n.x.G)+\'v\',U:\'1u%\',3a:n.y.G+\'v\',H:\'1J\'});n.y.K=a.1D;a.B.19=\'1z\'}},5Q:u(){n.64([\'3D\',\'caption\'],C);q(n.3D&&n.3N)n.3D.17+=\' p-22\';O(r a=0;a<p.1e.W;a++){r b=p.1e[a],c=b.4y,d=b.2l;q((!c&&!d)||(c&&c==n.3y)||(d&&d===n.2l)){n.3E(b)}}r g=[];O(r a=0;a<n.1e.W;a++){r b=p.$(\'23\'+n.1e[a]);q(/6b$/.T(b.35))n.3F(b);L p.1N(g,b)}r f=n.x.I+n.x.R+n.x.K;q(p.4Z&&f<p.1M){n.x.I+=(p.1M-f)/2;n.x.K+=(p.1M-f)/2}O(r a=0;a<g.W;a++)n.3F(g[a]);n.6c=C},6a:u(){q(!n.1k)n.1k=p.X(\'1I\',E,{19:\'1z\',H:n.x.z?n.x.z+\'v\':n.x.R+\'v\',P:0,1j:\'Q\',28:\'Q\',1h:p.ie?4:E},p.1p,C)},2b:u(a,b){p.J(n.1k,{H:n.x.z+\'v\',P:n.y.z+\'v\'});q(a||b){O(r c=0;c<n.1e.W;c++){r d=p.$(\'23\'+n.1e[c]);q(d&&/^(2K|3b)$/.T(d.35)){q(p.ie&&(p.2n()<=6||V.3Y==\'5g\')){d.B.H=(n.1k.1C+2*n.x.G+n.x.I+n.x.K)+\'v\'}n.y[d.35==\'2K\'?\'I\':\'K\']=d.1D}}}q(a){p.J(n.M,{U:n.y.I+\'v\'});p.J(n.1k,{U:(n.y.I+n.y.G)+\'v\'})}},60:u(){r a=n.1k;p.J(a,{U:(n.y.I+n.y.G)+\'v\',S:(n.x.I+n.x.G)+\'v\',28:\'1n\'});q(p.3e)a.B.1j=\'1n\';n.N.1Y(a);O(r b=0;b<n.1e.W;b++){r c=p.$(\'23\'+n.1e[b]);c.B.1h=4;q(!c.2z||n.4I)p.1y(c,0,c.1l)}},5S:u(){n.3G=p.X(\'a\',{1Z:\'5D:p.F[\'+n.16+\'].6d();\',2W:p.1o.4Q,17:\'p-R-3h\'});n.3E({4K:n.3G,19:p.4X,2z:C,1l:p.4Y})},6d:u(){1f{q(n.3G)p.2v(n.3G);n.2s();n.x.D=2D(n.N.B.S)-(n.x.R-n.M.H)/2;q(n.x.D<p.2h)n.x.D=p.2h;n.N.B.S=n.x.D+\'v\';p.J(n.M,{H:n.x.R+\'v\',P:n.y.R+\'v\'});n.x.z=n.x.R;n.y.z=n.y.R;q(n.1k)n.2b(C);p.J(n.N,{H:(n.x.I+2*n.x.G+n.x.z+n.x.K)+\'v\',P:(n.y.I+2*n.y.G+n.y.z+n.y.K)+\'v\'});q(n.Z)n.Z.2C(n);n.4m()}1g(e){1b.4D.1Z=n.M.18}},4m:u(){r a={x:2D(n.N.B.S)-20,y:2D(n.N.B.U)-20,w:n.M.1C+40+n.x.I+n.x.K,h:n.M.1D+40+n.y.I+n.y.K};q(p.3A)n.1G(\'4E\',\'Q\',a);q(p.3B)n.1G(\'4F\',\'Q\',a);q(p.3f)n.1G(\'*\',\'Q\',a)},4H:u(){n.a.17=n.a.17.2Q(\'p-5V-5W\',\'\');q(p.3A)n.1G(\'4E\',\'1n\');q(p.3B)n.1G(\'4F\',\'1n\');q(p.3f)n.1G(\'*\',\'1n\');q(n.Z&&n.1U)n.Z.3w();p.2v(n.N);p.F[n.16]=E;p.5s()}};q(V.5M&&p.ie){(u(){1f{V.3g.doScroll(\'S\')}1g(e){26(arguments.callee,50);A}p.5F()})()}p.3v=p.1o;r HsExpander=p.2O;p.1R(V,\'4i\',u(a){p.3c={x:a.3p,y:a.3q}});p.1R(V,\'5u\',p.4g);p.1R(V,\'5x\',p.4g);p.1R(1b,\'load\',p.5B);',[],386,'|||||||||||||||||||||||this||hs_one|if|var|||function|px||||span|return|style|true|min|null|expanders|cb|width|p1|setStyles|p2|else|content|wrapper|for|height|hidden|full|left|test|top|document|length|createElement|Math|outline||false|||||key|className|src|position|tpos|window|typeof|outlineType|overlays|try|catch|zIndex|loading|visibility|overlayBox|opacity||visible|lang|container|target|dragArgs||marginMin|100|undefined|case|image|fade|absolute|table|offset|offsetWidth|offsetHeight|page|minSpan|showHideElements|type|div|auto|graphic|right|minWidth|push|focusKey||close|addEventListener|marginMax|clientSpan|outlineWhileAnimating|bottom|pendingOutlines|opera|appendChild|href||getExpander|move|hsId|fading||setTimeout||overflow|contentType|scroll|sizeOverlayBox|xspan|yspan|xp1|yp1||marginLeft|marginBottom|minHeight|allowSizeReduction|slideshowGroup|none|ieVersion|scrollLeft|scrollTop|while|new|focus|onclick||discardElement|parentNode|resize|cursor|hideOnMouseOut|img|9999px|setPosition|parseInt|xmin|ymin|xp2|yp2|zIndexCounter|preloadTheseImages|above|navigator||getParams|Expander|removeEventListener|replace|match|isExpanded|styleRestoreCursor||Outline|title|anchors|justify|round||setAttribute||||hsPos|graphicsDir||||marginTop|below|mouse|faders|safari|geckoMac|documentElement|expand|display|previousOrNext|keyHandler|event|preventDefault|isHsAnchor|exp|clientX|clientY|hasDragged||preloadFullImage|onload|langDefaults|destroy|isImage|thumbsUserSetId|onLoadStarted|hideSelects|hideIframes||heading|createOverlay|positionOverlay|fullExpandLabel|restoreTitle|restoreCursor|250|marginRight|numberOfImagesToPreload|outlineStartOffset|dragByHeading|wrapperClassName|continuePreloading|overrides|maxWidth|idCounter|center|middle|clones|setAttribs|filter|compatMode|body||getPosition|getParam|getSrc|getNode|cloneNode|garbageBin|innerHTML|updateAnchors|getAdjacentAnchor|srcElement|break|keypress|keydown|getWrapperKey|string|mouseClickHandler|isClosing|mousemove|dragHandler|blur|hasFocused|redoShowHide||relatedTarget|images|init|onDomReady|getElementsByTagName|groups|step|onLoad|hasAlphaImageLoader|relative|thumbnailId|cancelLoading|Create|connectOutline|showLoading|location|SELECT|IFRAME|changeSize|afterClose|mouseIsOver|Text|overlayId|origProp|pointer|loadingText|loadingTitle|focusTitle|fullExpandTitle|expandSteps|expandDuration|restoreSteps|restoreDuration|loadingOpacity|allowMultipleInstances|fullExpandPosition|fullExpandOpacity|padToMinWidth||enableKeyListener|200|captionOverlay|headingOverlay|maxHeight|easing|easingClose|fadeInOut|leftpanel|rightpanel|all|userAgent|appVersion|parseFloat|getPageSize|BackCompat|clientWidth|self|offsetLeft|offsetTop|offsetParent|focusTopmost|last|upcoming|form|number|toString|reOrder|html|mousedown|clickX|clickY|mouseup|pow|wrapperMouseHandler|detachEvent|preloadImages|getAnchors|javascript|easeInQuad|domReady|isDomReady|abs|preloadGraphic|prototype|onGraphicLoad|url|readyState|thumb|contentLoaded|block|getOverlays|correctRatio|createFullExpand|show|fitOverlayBox|active|anchor|setSize|afterExpand|prepareNextOutline|showOverlays|preloadNext|getAnchorIndex|slideshow|getInline|Eval|nextSibling|Overlay|getAttribute|hand|genOverlayBox|panel|gotOverlays|doFullExpand'.split('|'),0,{}));
/* JsHttpRequest */
eval(function(p,a,c,k,e,r){
    e=function(c){
        return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))
    };
        
    if(!''.replace(/^/,String)){
        while(c--)r[e(c)]=k[c]||e(c);
        k=[function(e){
            return r[e]
        }];
        e=function(){
            return'\\w+'
        };
            
        c=1
    };
    while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);
    return p
}('u 8(){7 t=5;t.1a=x;t.R=0;t.Q=x;t.1R=x;t.S=3e;t.2h="3f";t.1i=x;t.1j=T;t.F=x;t.1B="3g";t.D=x;t.U=[];t.12=x;t.1k={2i:"3h 1C 2j 3i: L=%, 3j=%",2k:"3k 3l, <E> 1S 2l a 3m 3n 2j 1D 1l 3o.",2m:"1T 3p 3q 3r 3s 1U 3t!\\n%",1E:"V 13 3u 3v 2n O W 2o (3w 1U 3x 3y % 3z)",2p:"3A F: %",2q:"3B 3C 3D 3E 3F, 3G 3H 8.14 3I",2r:"V 3J a F 3K 3L 3M 1l 2o. 3N 1V:\\n%",1W:"3O 1m() 3P 2s 3Q O 1l % F."};t.1n=u(){O(5){6(D&&D.1n){D.1n()}1X();6(R==0){9}6(R==1&&!D){R=0;9}15(4,P)}};t.1Y=u(a,b,c,d,f){O(5){1b{6(1c.2t.3R.1F(I M("[&?]"+1B+"=([^&?]*)"))||1c.3S.1F(I M("(?:;|^)\\\\s*"+1B+"=([^;]*)"))){b+=(b.X("?")>=0?"&":"?")+1B+"="+5.1d(M.$1)}}1e(e){}12={B:(a||"").1G(),y:b,3T:c,1Z:d!=x?d:"",20:f!=x?f:""};D=x;15(1,P);9 P}};t.21=u(a){6(!5.R){9}5.15(1,P);5.D=x;7 b=[];7 c=[];6(!5.22(a,x,b,c)){9}7 d=x;6(5.1j&&!c.A){d=5.12.1Z+":"+5.12.20+"@"+5.12.y+"|"+b+"#"+5.12.B;7 e=8.23[d];6(e){5.24(e[0],e[1]);9 T}}7 f=(5.F||"").25();6(f&&!8.14[f]){9 5.Y("2p",f)}7 g=[];7 h=8.14;J(7 i 1D h){7 j=h[i].F;6(!j){1H}6(f&&i!=f){1H}7 k=I j(5);8.1f(k,5.12);8.1f(k,{N:b.2u("&"),K:c,G:(I 3U().3V())+""+8.2v++,2w:d,Z:x});7 l=k.1o();6(!l){5.D=k;8.1p[k.G]=5;9 P}6(!f){g[g.A]="- "+i.1G()+": "+5.26(l)}C{9 5.Y(l)}}9 i?5.Y("2r",g.2u("\\n")):5.Y("2q")};t.1q=u(){O(5){9 D&&D.1q?D.1q():[]}};t.1r=u(a){O(5){9 D&&D.1r?D.1r():[]}};t.1m=u(a,b){O(5){U[U.A]=[a,b]}};t.24=u(a,b){O(5){6(1j&&D){8.23[D.2w]=[a,b]}6(a!==x||b!==x){S=4;Q=1R=a;1i=b}C{S=3W;Q=1R=1i=x}15(2);15(3);15(4);1X()}};t.26=u(b){7 i=0,p=0,16=5.1k[b[0]];3X((p=16.X("%",p))>=0){7 a=b[++i]+"";16=16.2x(0,p)+a+16.2x(p+1,16.A);p+=1+a.A}9 16};t.Y=u(a){a=5.26(2y(a)=="2z"?3Y:a);a="8: "+a;6(!H.1I){1J a;}C{6((I 1I(1,"2A")).3Z=="2A"){1J I 1I(1,a);}C{1J I 1I(a);}}};t.22=u(a,b,c,d){6(b==x){b=""}6(a 27 2C){7 f=T;J(7 k 1D a){7 v=a[k];6(v 27 40){1H}7 g=b?b+"["+5.1d(k)+"]":5.1d(k);7 h=v&&v.1K&&v.1K.2D&&v.1L;6(h){7 i=v.1L.1G();6(i=="1C"){f=P}C{6(i=="2E"||i=="41"||i=="42"){}C{9 5.Y("2i",(e.L||""),e.1L)}}d[d.A]={L:g,e:v}}C{6(v 27 2C){5.22(v,g,c,d)}C{6(v===x){1H}c[c.A]=g+"="+5.1d(""+v)}}6(f&&d.A>1){9 5.Y("2k")}}}C{c[c.A]=a}9 P};t.1X=u(){7 a=5.D;6(!a){9}8.1p[a.G]=T;7 b=a.Z;6(!b){9}a.Z=x;7 c=u(){b.1K.2F(b)};8.1s(c,50)};t.15=u(s,a){O(5){6(a){S=2h=1i=x;Q=""}R=s;6(1a){1a()}}};t.1d=u(s){9 1d(s).43(I M("\\\\+","g"),"%2B")}}8.2v=0;8.17=44;8.23={};8.1p={};8.14={};8.2G=u(){};8.1g={s:H.1s,c:H.2H};8.1s=u(a,b){H.18=8.1g.s;6(2y(a)=="2z"){c=H.18(a,b)}C{7 c=x;7 d=u(){a();28 8.1g[c]};c=H.18(d,b);8.1g[c]=d}H.18=x;9 c};8.2H=u(a){H.18=8.1g.c;28 8.1g[a];7 r=H.18(a);H.18=x;9 r};8.2n=u(a,b,c,d){7 e=I 5();e.1j=!d;e.1a=u(){6(e.R==4){c(e.1i,e.Q)}};7 f=x;6(a.1F(/^((\\w+)\\.)?(W|19)\\s+(.*)/i)){e.F=M.$2?M.$2:x;f=M.$3;a=M.$4}e.1Y(f,a,P);e.21(b)};8.29=u(d){7 a=5.1p[d.G];28 5.1p[d.G];6(a){a.24(d.45,d.46)}C{6(a!==T){1J"29(): 47 48 G: "+d.G;}}};8.1f=u(a,b){J(7 k 1D b){a[k]=b[k]}};8.14.2I={F:u(d){8.1f(d.1k,{2J:"V 13 1h 2K 2L F: 1t 2M",2N:"V 13 1h 1u 1o 2a 49 2O 4a %",2P:"V 13 1h F 2K 2L F, 19 B: 4b 4c 1U 1t 2M, 4d 1u 2s O 4e 4f",2Q:"V 13 1h F: 2R E 11 2S 2T 2U 1V 1t 2V"});5.1o=u(){6(5.K.A){9["2Q"]}6(5.y.1F(I M("^([a-z]+)://([^\\\\/]+)(.*)","i"))){6(M.$2.25()==1c.2t.4g.25()){5.y=M.$3}C{9["2N",M.$2]}}7 a=x;6(H.1h){1b{a=I 1h()}1e(e){}}C{6(H.1M){1b{a=I 1M("4h.2W")}1e(e){}6(!a){1b{a=I 1M("4i.2W")}1e(e){}}}}6(!a){9["2J"]}7 b=H.1M||a.1m;6(!5.B){5.B=b?"19":"W"}6(5.B=="W"){6(5.N){5.y+=(5.y.X("?")>=0?"&":"?")+5.N}5.N="";6(5.y.A>8.17){9["1E",8.17]}}C{6(5.B=="19"&&!b){9["2P"]}}5.y+=(5.y.X("?")>=0?"&":"?")+"8="+(d.1j?"0":5.G)+"-2I";7 c=5.G;a.1a=u(){6(a.R!=4){9}a.1a=8.2G;d.S=x;1b{d.S=a.S;d.Q=a.Q}1e(e){}6(!d.S){9}1b{4j("8.2b = u(G) { 7 d = "+d.Q+"; d.G = G; 8.29(d); }")}1e(e){9 d.Y("2m",d.Q)}8.2b(c);8.2b=x};a.1Y(5.B,5.y,P,5.1Z,5.20);6(b){J(7 i=0;i<d.U.A;i++){a.1m(d.U[i][0],d.U[i][1])}a.1m("4k-4l","4m/4n-4o")}a.21(5.N);5.Z=x;5.1v=a;9 x};5.1q=u(){9 5.1v.1q()};5.1r=u(a){9 5.1v.1r(a)};5.1n=u(){5.1v.1n();5.1v=x}}};8.14.2c={F:u(e){8.1f(e.1k,{2X:"V 13 1w F: 4p 4q 4r W B",2Y:"V 13 1w F: 2R E 11 2S 2T 2U 1V 1t 2V"});5.1o=u(){6(5.N){5.y+=(5.y.X("?")>=0?"&":"?")+5.N}5.y+=(5.y.X("?")>=0?"&":"?")+"8="+5.G+"-"+"2c";5.N="";6(!5.B){5.B="W"}6(5.B!=="W"){9["2X"]}6(5.K.A){9["2Y"]}6(5.y.A>8.17){9["1E",8.17]}6(e.U.A){9["1W","1w"]}7 a=5,d=1c,s=x,b=d.2d;6(!H.4s){5.Z=s=d.1x("1w");7 c=u(){s.2Z="1T";6(s.1y){s.1y("1N",a.y)}C{s.1N=a.y}b.2e(s,b.1z)}}C{5.Z=s=d.1x("4t");s.1O.4u="30";b.2e(s,b.1z);s.31="4v J 32.<s"+"4w></"+"2c>";7 c=u(){s=s.4x("1w")[0];s.2Z="1T";6(s.1y){s.1y("1N",a.y)}C{s.1N=a.y}}}8.1s(c,10);9 x}}};8.14.E={F:u(t){8.1f(t.1k,{33:"34 \\"%\\" 4y 1t 35 1u 4z E!",36:"34 \\"%\\" 4A 1u a 2O E. 4B 11 1S 35 1u 1l 4C E!",37:"4D \\"1A\\" 4E 1l E 1S 2l \\"%\\" (J 32), \\"%\\" 4F."});5.1o=u(){7 g=5;6(!g.B){g.B="19"}g.y+=(g.y.X("?")>=0?"&":"?")+"8="+g.G+"-"+"E";6(t.U.A){9["1W","1C"]}6(g.B=="W"){6(g.N){g.y+=(g.y.X("?")>=0?"&":"?")+g.N}6(g.y.A>8.17){9["1E",8.17]}7 p=g.y.2f("?",2);g.y=p[0];g.N=p[1]||""}7 h=x;7 j=T;6(g.K.A){6(g.K[0].e.1L.1G()=="1C"){h=g.K[0].e;j=P;g.K=[]}C{h=g.K[0].e.E;J(7 i=0;i<g.K.A;i++){7 e=g.K[i].e;6(!e.E){9["33",e.L]}6(e.E!=h){9["36",e.L]}}}6(g.B=="19"){7 l="38/E-2a";7 m=(h.1P.39&&h.1P.39.4G)||(h.1P.1A&&h.1P.1A.3a)||h.1A;6(m!=l){9["37",l,m]}}}7 d=h&&(h.4H||h.1c)||1c;7 o="4I"+g.G;7 s=g.Z=d.1x("4J");s.1O.4K="4L";s.1O.4M="2g";s.31=(h?"":"<E"+(g.B=="19"?" 1A=\\"38/E-2a\\" B=\\"4N\\"":"")+"></E>")+"<3b L=\\""+o+"\\" G=\\""+o+"\\" 1O=\\"4O:3c; 4P:3c; 4Q:2g; 4R:30\\"></3b>";6(!h){h=g.Z.4S}d.2d.2e(s,d.2d.1z);7 q=u(e,a){7 b=[];7 c=e;6(e.1Q){7 c=d.1x("E");c.1Q(e,T)}J(7 i=0;i<a.A;i++){7 k=a[i][0],v=a[i][1];b[b.A]=[k,c.4T(k)];c.1y(k,v)}6(e.1Q){e.1Q(c,T)}9 b};7 r=u(){4U.4V=8;7 a=[];6(!j){J(7 i=0,n=h.11.A;i<n;i++){a[i]=h.11[i].L;h.11[i].L=""}}7 b=g.N.2f("&");J(7 i=b.A-1;i>=0;i--){7 c=b[i].2f("=",2);7 e=d.1x("2E");e.4W="2g";e.L=3d(c[0]);e.3a=c[1]!=x?3d(c[1]):"";h.2D(e)}J(7 i=0;i<g.K.A;i++){g.K[i].e.L=g.K[i].L}7 f=q(h,[["4X",g.y],["B",g.B],["4Y",x],["4Z",o]]);h.51();q(h,f);J(7 i=0;i<b.A;i++){h.1z.1K.2F(h.1z)}6(!j){J(7 i=0,n=h.11.A;i<n;i++){h.11[i].L=a[i]}}};8.1s(r,52);9 x}}};',62,313,'|||||this|if|var|JsHttpRequest|return|||||||||||||||||||||function|||null|url||length|method|else|_ldObj|form|loader|id|window|new|for|queryElem|name|RegExp|queryText|with|true|responseText|readyState|status|false|_reqHeaders|Cannot|GET|indexOf|_error|span||elements|_openArgs|use|LOADERS|_changeReadyState|msg|MAX_URL_LEN|JsHttpRequest_tmp|POST|onreadystatechange|try|document|escape|catch|extend|TIMEOUTS|XMLHttpRequest|responseJS|caching|_errors|the|setRequestHeader|abort|load|PENDING|getAllResponseHeaders|getResponseHeader|setTimeout|not|to|xr|SCRIPT|createElement|setAttribute|lastChild|enctype|session_name|FORM|in|url_too_long|match|toUpperCase|continue|Error|throw|parentNode|tagName|ActiveXObject|src|style|attributes|mergeAttributes|responseXML|must|JavaScript|is|are|no_headers|_cleanup|open|username|password|send|_hash2query|CACHE|_dataReady|toLowerCase|_l|instanceof|delete|dataReady|data|_tmp|script|body|insertBefore|split|hidden|statusText|inv_form_el|element|must_be_single_el|be|js_invalid|query|request|unk_loader|no_loaders|no_loader_matched|work|location|join|COUNT|hash|substring|typeof|string|test||Object|appendChild|INPUT|removeChild|_dummy|clearTimeout|xml|xml_no|or|ActiveX|supported|xml_no_diffdom|different|xml_no_headers|xml_no_form_upl|direct|using|and|uploading|implemented|XMLHTTP|script_only_get|script_no_form|language|none|innerHTML|IE|form_el_not_belong|Element|belong|form_el_belong_diff|form_el_inv_enctype|multipart|encType|value|iframe|0px|unescape|200|OK|PHPSESSID|Invalid|detected|tag|If|used|single|HTML|list|code|generated|by|backend|invalid|so|long|URL|larger|than|bytes|Unknown|No|loaders|registered|at|all|please|check|array|find|which|may|process|Notices|Method|cannot|together|search|cookie|asyncFlag|Date|getTime|500|while|arguments|description|Function|TEXTAREA|SELECT|replace|2000|text|js|unknown|pending|from|domain|headers|setting|needed|encodings|correctly|hostname|Microsoft|Msxml2|eval|Content|Type|application|octet|stream|it|supports|only|opera|SPAN|display|Workaround|cript|getElementsByTagName|does|any|belongs|All|same|Attribute|of|given|nodeValue|ownerDocument|jshr_i_|DIV|position|absolute|visibility|post|width|height|overflow|border|firstChild|getAttribute|top|JsHttpRequestGlobal|type|action|onsubmit|target||submit|100'.split('|'),0,{}))

/* GALLERY SETTINGS */
hs.graphicsDir = '/js/highslide/graphics/';
hs.align = 'center';
hs.transitions = ['expand', 'crossfade'];
hs.fadeInOut = true;
hs.dimmingOpacity = 0.8;
hs.outlineType = 'rounded-white';
hs.marginBottom = 105;
hs.addSlideshow({
    //slideshowGroup: 'group1',
    interval: 5000,
    repeat: false,
    useControls: true,
    overlayOptions: {
        className: 'text-controls',
        position: 'bottom center',
        relativeTo: 'viewport',
        offsetY: -60
    },
    thumbstrip: {
        position: 'bottom center',
        mode: 'horizontal',
        relativeTo: 'viewport'
    }
});


/* ONE IMAGE SETTINGS */
hs_one.graphicsDir = '/js/highslide/graphics/';
hs_one.outlineType = 'rounded-white';
hs_one.transitions = ['expand', 'crossfade'];
hs_one.fadeInOut = true;


function $w(id){
    return document.getElementById(id);
}
Array.prototype.inArray = function (value) {
    var i;
    for (i=0; i < this.length; i++) if (this[i] === value) return true;
    return false;
};
function insertAfter(parent, node, referenceNode) {
    parent.insertBefore(node, referenceNode.nextSibling);
}
function toggle(obj) {
    var el = $w(obj);
    el.style.display = (el.style.display != 'none') ? 'none' : '';
}
function addEvent(elm, evType, fn, useCapture) {
    if (useCapture==undefined) useCapture = false;
    if (elm.addEventListener) {
        elm.addEventListener(evType, fn, useCapture);
        return true;
    }
    else if (elm.attachEvent) {
        var r = elm.attachEvent('on' + evType, fn);
        return r;
    }
    else elm['on' + evType] = fn;
}
// addEvent(window,'load',func1,false);

function _key(event)	{

    if (event) {
        var k = event.keyCode;
        if(k==0) {
            k=event.charCode;
            return false;
        }
        if(k==13 && $w('loading-box').style.display == 'block')  {
            $w('loading-box').style.display = 'none';
            if (OK==true) remove_func();
            if (set_focus != '' && set_focus != undefined) {
                set_focus.focus();
                if (set_focus!=null && set_focus.className == 'inp_text') set_focus.className = 'inp_text_err';
            }
            return false;
        }
        if(k==27) {
            if ($w('loading-box').style.display == 'block') $w('loading-box').style.display = 'none';
            if (set_focus != '' && set_focus != undefined) {
                set_focus.focus();
                if (set_focus!=null && set_focus.className == 'inp_text') set_focus.className = 'inp_text_err';
            }
            return false;
        }
        if(k==37 && event.ctrlKey && $w('prev_page'))  {
            // left
            if ($w('prev_page').href.length>0) location.href = $w('prev_page').href;
        }
        if(k==39 && event.ctrlKey && $w('next_page')) {
            // right
            if ($w('next_page').href.length>0) location.href = $w('next_page').href;
        }
    }

}


var mes = {
    lang: {
        ru: {
            'close': 'Закрыть', 
            'ok': 'Подтвержить действие', 
            'wait': 'пожалуйста подождите', 
            'cancel': 'Отменить', 
            'loading': 'Обработка данных'
        },
        en: {
            'close': 'Close', 
            'ok': 'Confirmed action', 
            'wait': 'please wait', 
            'cancel': 'Cancel', 
            'loading': 'Data processing'
        }
    },
    /* Закрыть окно */
    close: function(){
        $w('loading-box').style.display = 'none';
    },
    /* ОКНО ЗАГРУЗЧИК */
    loading: function(text){
        if (!$w('loading-box')) return false;
        if (text==undefined) text = 'Обработка данных';
        var top = (document.body.scrollTop>0) ? document.body.scrollTop : document.documentElement.scrollTop;
        $('#loading-box').css({
            'width': '180px', 
            'height': 'auto', 
            'textAlign': 'center', 
            'display': 'block'
        });
        $('#loading-text').css({
            'backgroundImage': 'none', 
            'padding': '0px'
        });
        //	$('#loading-box').fadeIn('fast');
        //   	$('#loading-actions').css({'display','none'});
        $w('loading-actions').style.display = 'none';
        top = (self.screen) ? (parseInt(top,10)+(screen.height/2)-200)+'px' : (parseInt(top,10)+(document.body.clientHeight/2)-90)+'px';
        var left = ((document.body.clientWidth/2)-100)+'px';
        $('#loading-box').css({
            'top': top, 
            'left': left
        });
        $w('loading-img').style.display = '';
        $('#loading-text').html(text+', пожалуйста подождите...');
    },

    /* ОКНО С СООБЩЕНИЕМ */
    show: function(status, text, focus, action){
        if (!$w('loading-box')) {
            if (text!=undefined) alert(text);
            return false;
        }
        if (status==undefined && $w('loading-box') && $w('loading-box').style.display == 'none') return false;
        OK = false;
        $w('loading-box').style.display = 'block';
        $('#loading-box').css({
            'textAlign': 'left'
        });
        $('#loading-box').show('fast');

        if (isIE6) $('#loading-box').css({
            'width': '400px', 
            'height': 'auto'
        });
        else {
            $w('loading-box').style.maxWidth = '600px';
            $('#loading-box').css({
                'width': 'auto', 
                'height': 'auto'
            });
        }
        $w('loading-actions').innerHTML = '';
        $w('loading-actions').style.display = 'none';
        $w('loading-text').style.paddingLeft = '27px';
        $w('loading-text').style.paddingTop = (isIE) ? '10px' : '20px';

        if (text==undefined && status!='error') text = 'Информация';
        if (action==undefined) action = '';

        if (status==undefined) {
            $w('loading-box').style.display = 'none';
            return false;
        }
        else if (status=='info') {
            $w('loading-img').style.display = 'none';
            //if (action) remove_func = new Function(action);
            $w('loading-text').style.backgroundImage = 'url(/_templates/'+config['template_dir']+'/cimages/icons/warning.png)';
            $w('loading-text').innerHTML = ''+text+'';
            $w('loading-actions').innerHTML += '&nbsp;&nbsp;<a href="#" title="Закрыть (ESC)" onclick="$(\'#loading-box\').hide(\'normal\'); if (set_focus != \'\') set_focus.focus(); return false;"><img class="image" src="/_templates/'+config['template_dir']+'/cimages/icons/btn_close.png" alt="Закрыть" />&nbsp;Закрыть</a>';
            $w('loading-actions').style.display = '';
        } else if (status=='basket') {

            if (sid_data!=undefined) {
                $w('loading-img').style.display = 'none';
                bas.show(sid_data);
            }else {
                $w('loading-img').style.display = 'none';
                $w('loading-text').style.backgroundImage = 'url(/_templates/'+config['template_dir']+'/cimages/icons/warning.png)';
                $w('loading-text').innerHTML = ''+text+'';
                $w('loading-actions').innerHTML += '&nbsp;&nbsp;<a href="/shopping_cart/" title="Перейти в корзину"><img class="image" src="/_templates/'+config['template_dir']+'/cimages/buttons/add_basket.png" alt="Перейти в корзину" />&nbsp;Перейти в корзину</a>'
                + '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="#" title="Отменить действие (ESC)" onclick="$(\'#loading-box\').hide(\'normal\'); return false;"><img class="image" src="/_templates/'+config['template_dir']+'/cimages/icons/btn_close.png" alt="Отмена" />&nbsp;Продолжить покупки</a>';
                $w('loading-actions').style.display = '';
            }



        } else if (status=='basket' || status=='basket_full') {
            $w('loading-img').style.display = 'none';
            $w('loading-text').style.backgroundImage = status=='basket_full' ? '' : 'url(/_templates/'+config['template_dir']+'/cimages/icons/warning.png)';
            $w('loading-text').innerHTML = ''+text+'';
        /*$w('loading-actions').innerHTML += '&nbsp;&nbsp;<a href="/shopping_cart/" title="Перейти в корзину"><img class="image" src="/_templates/'+config['template_dir']+'/cimages/buttons/add_basket.png" alt="Перейти в корзину" />&nbsp;Перейти в корзину</a>'
										+ '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="#" title="Отменить действие (ESC)" onclick="$(\'#loading-box\').hide(\'normal\'); return false;">&nbsp;Продолжить покупки</a>';
	    $w('loading-actions').style.display = '';
*/
        } else if (status=='confirm') {
            OK = true;
            if (action) remove_func = new Function(action);
            $w('loading-img').style.display = 'none';
            $w('loading-text').style.backgroundImage = 'url(/_templates/'+config['template_dir']+'/cimages/icons/warning.png)';
            $w('loading-text').innerHTML = ''+text+'';
            $w('loading-actions').innerHTML += '&nbsp;&nbsp;<a href="#" title="Подтвердить действие (Enter)" onclick="$w(\'loading-box\').style.display = \'none\'; if (OK==true) remove_func(); return false;"><img class="image" src="/_templates/'+config['template_dir']+'/cimages/icons/btn_apply.png" alt="OK" />&nbsp;OK</a>'
            + '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="#" title="Отменить действие (ESC)" onclick="$(\'#loading-box\').hide(\'normal\'); return false;"><img class="image" src="/_templates/'+config['template_dir']+'/cimages/icons/btn_close.png" alt="Отмена" />&nbsp;Отмена</a>';
            $w('loading-actions').style.display = '';

        } else if (status=='step') {
            OK = true;
            $w('loading-img').style.display = 'none';
            $w('loading-text').innerHTML = ''+text;
            $w('loading-actions').innerHTML += '<a href="#" onclick="'+action+';"><b>Далее</b>&nbsp;<img class="image" src="_design/img/forms/btn_show_sidebar.png" alt="" /></a>';
            $w('loading-actions').style.display = '';

        } else if (status=='error') {
            $w('loading-img').style.display = 'none';
            if (text==undefined) text = 'Произошла ошибка';
            $w('loading-text').style.backgroundImage = 'url(/_templates/'+config['template_dir']+'/cimages/icons/error.png)';
            $w('loading-text').innerHTML = ''+text+'';
            $w('loading-actions').style.display = '';
            $w('loading-actions').innerHTML += '&nbsp;&nbsp;<a href="#" title="Закрыть (ESC)" onclick="$(\'#loading-box\').hide(\'normal\'); if (set_focus != \'\') set_focus.focus(); return false;"><img class="image" src="/_templates/default/cimages/icons/btn_close.png" alt="Закрыть" />&nbsp;Закрыть</a>';
        }else if (status=='actions') {
            $w('loading-img').style.display = 'none';
            if (text==undefined) text = 'Произошла ошибка';
            $w('loading-text').style.backgroundImage = 'url(/_templates/'+config['template_dir']+'/cimages/icons/warning.png)';
            $w('loading-text').innerHTML = ''+text+'';
            $w('loading-actions').style.display = '';
            $w('loading-actions').innerHTML += '<input type="button" value="Отказаться от скидки" onclick="set_discount(0); $(\'#loading-box\').hide(\'normal\'); if (set_focus != \'\') set_focus.focus(); return false;"> &nbsp; <input type="button"  onclick="$(\'#loading-box\').hide(\'normal\'); if (set_focus != \'\') set_focus.focus(); return false;" value="Ввести правильный номер телефона">';
        }

        /*if ($w('loading-box').offsetHeight>500){
		$w('loading-box').style.height = '500px';
		$w('loading-box').style.overflow = 'auto';
		}
    */

        var new_height = $w('loading-box').offsetHeight;
        var top = (document.body.scrollTop>0) ? document.body.scrollTop : document.documentElement.scrollTop;
        //$w('loading-box').style.top = (parseInt(top,10)+(document.body.clientHeight/2)-(new_height/2)-30)+'px';
        var half_screen_height = document.body.clientHeight/2;
        if (isIE6) {
            half_screen_height = (screen.height>0) ? (screen.height/2)-parseInt(screen.height/8) : half_screen_height;
        }
        $w('loading-box').style.top = (parseInt(top,10)+(half_screen_height)-(new_height/2)-30)+'px';

        var new_width = $w('loading-box').offsetWidth;
        $w('loading-box').style.left = ((document.body.clientWidth/2)-(new_width/2))+'px';
        if (focus!=undefined && $w(focus)!=null) {
            set_focus = $w(focus);
            if (set_focus!=null && set_focus.className == 'inp_text') set_focus.className = 'inp_text_err';
        }
        else set_focus = '';

        $w('loading-box').focus();
        if (isIE) {
            $w('loading-text').style.backgroundPosition = '0 12px';
            reloadPage();
        }
    }
}




// ****************************************** //
// **** <<<<<< КОРЗИНА ПОЛЬЗОВАТЕЛЯ    ****** //
// ****************************************** //

function check_basket(){
    var result = true;
    if ($w('empty_shopping_cart')!=null) result = ($w('empty_shopping_cart').style.display == '') ? false : true;
    if (result == false) mes.show('info', 'Ваша корзина пуста');
    return result;
}

// добавить позицию в корзину
function add_product(sid, catalog_id, id, price, action) {

    var req = new JsHttpRequest();
    req.open(null, '/js/_ajax/basket/add.php', true);
    var data = {
        'sid': sid, 
        'catalog_id': catalog_id, 
        'id': id, 
        'price' : price
    };
    req.send(data);

    if (action!='купить') mes.loading('Добавление товара в корзину');

    req.onreadystatechange = function() {
        //if (req.responseText) alert(req.responseText);
        if (req.readyState == 4) {

            var quantity = req.responseJS.quantity;
            var total_price = req.responseJS.total_price;
            var content = req.responseJS.content;

            if (quantity>0) {
                if ($w('empty_shopping_cart') != null) $w('empty_shopping_cart').style.display = 'none';
                if ($w('shopping_cart') != null) $w('shopping_cart').style.display = '';
                if ($w('quantity') != null) $w('quantity').innerHTML = quantity;
                if ($w('total_price') != null) $w('total_price').innerHTML = total_price;
                if ($w('ending') != null) $w('ending').innerHTML = req.responseJS.end;
                if ($w('basket_'+id) != null) $w('basket_'+id).src = '/_templates/'+config['template_dir']+'/cimages/buttons/add_basket_full.png';
            }

            if (action == 'купить') location.href='/shopping_cart/';
            else if (content) mes.show('basket_full',content);
            else mes.show('basket','Товар добавлен в корзину<br>&nbsp;Приятных, Вам, покупок');

        }

    }
}

/* КОРЗИНА */
var bas = {
    plus: function(id,sid){
        id = '#quantity_'+id;
        $(id).val(parseInt($(id).val())+1);
        recount(sid);
    },
    minus: function(id,sid){
        id = '#quantity_'+id;
        var value = parseInt($(id).val())-1;
        if (value>0) {
            $(id).val(value);
            recount(sid);
        }
        else mes.show('info','Кол-во товара должно быть больше нуля!', 'quantity_'+id);

    },
    get_content: function(sid){

        var req = new JsHttpRequest();
        req.open(null, '/js/_ajax/basket/get_basket.php', true);
        var data = {
            'sid': sid
        };
        req.send(data);

        mes.loading();

        req.onreadystatechange = function() {
            //if (req.responseText) $('#debug').html(req.responseText);
            if (req.readyState == 4) {
                if (req.responseJS.result) {
                    mes.show('basket_full',req.responseJS.result);
                } else mes.close();
            }
        }

    },
    close: function(){
    //$('#basket_block_popup').fadeOut();
    }
}

// удаление позиции из корзины
function remove_product(sid, id, catalog_id){
    var req = new JsHttpRequest();
    req.open(null, '/js/_ajax/basket/remove.php', true);
    var data = {
        'sid': sid, 
        'id': id, 
        'catalog_id': catalog_id
    };
    req.send(data);

    mes.loading('Удаление товара');

    req.onreadystatechange = function() {
        if (req.readyState == 4) {

            var show_basket = false;
            if ($w('tr_'+id)){
                var parent = $w('tr_'+id).parentNode.id;
                removeElement(parent,'tr_'+id);
                if ($w(parent)) {
                    var parent_table = $w(parent).parentNode.id;
                    var trs = $w(parent).getElementsByTagName('tr').length;
                    if (trs-2 == 0 && parent_table) $w(parent_table).style.display = 'none';
                }
            } else show_basket = true;

            var quantity = req.responseJS.quantity;
            var total_price = req.responseJS.total_price;

            if (quantity>0) {
                var ids = req.responseJS.ids;
                if (ids && $w('recount_ids')) $w('recount_ids').value = ids;
                //if ($w('delivery_type')!=null) var delivery = $w('delivery_type').value;
                if ($w('t_price')) $w('t_price').innerHTML = total_price+'';
                //$w('price_delivery').innerHTML = total_price+' руб.';
                if ($w('empty_shopping_cart')) $w('empty_shopping_cart').style.display = 'none';
                if ($w('shopping_cart')) $w('shopping_cart').style.display = '';
                if ($w('quantity')) $w('quantity').innerHTML = quantity;
                if ($w('total_price')) $w('total_price').innerHTML = total_price;
                if ($w('ending')) $w('ending').innerHTML = req.responseJS.end;
                //if ($w('delivery_type')!=null) choose_delivery_type(delivery);
                if (show_basket) bas.get_content(sid);
            }
            else {
                if ($w('empty_shopping_cart')) $w('empty_shopping_cart').style.display = '';
                if ($w('shopping_cart')) $w('shopping_cart').style.display = 'none';
                if ($w('whole_basket')) $w('whole_basket').innerHTML = '<h5 class="proces_order_title">Ваша корзина пуста</h5>';
                if ($w('order_form')!=null) $w('order_form').style.display = 'none';
                if (show_basket) mes.show('info','Ваша корзина пуста');
            }

            if (!show_basket) mes.show();
        }

    }
}
// сообщение об удалении
function remove_message(sid, p_id, c_id, name){
    remove_func = new Function("remove_product('"+sid+"', '"+p_id+"', '"+c_id+"');");
    mes.show('confirm','Вы действительно хотите удалить "'+name+'" из корзины?');
}


// удаление позиции из корзины
function ask_clear_basket(sid){
    remove_func = new Function("clear_basket('"+sid+"');");
    mes.show('confirm','Вы действительно хотите очистить корзину?');
}

function clear_basket(sid){
    var req = new JsHttpRequest();
    req.open(null, '/js/_ajax/basket/clear.php', true);
    var data = {
        'sid': sid
    };
    req.send(data);

    mes.loading('Очистка корзины');

    req.onreadystatechange = function() {
        if (req.readyState == 4) {
            var result = req.responseJS.result;
            if (result){
                if ($w('empty_shopping_cart')) $w('empty_shopping_cart').style.display = '';
                if ($w('shopping_cart')) $w('shopping_cart').style.display = 'none';
                $w('whole_basket').innerHTML = '<h5 class="proces_order_title">Ваша корзина пуста</h5>';
                if ($w('order_form')!=null) $w('order_form').style.display = 'none';
                mes.show();
            } else mes.show('errors','Ошибка очистки корзины');
        }
    }
}


// пересчитать сумму в корзине
function recount(sid){
    var req = new JsHttpRequest();

    var products = new Array();
    if ($w('recount_ids')!=null) products = $w('recount_ids').value.split(',');

    if (products.length>0) {
        var j = 0, k = 0;
        var values = new Array();
        var products_id = new Array();
        var new_prices = new Array();

        for (i = 0; i<products.length; i++) if ($w('quantity_'+products[i])!=null) {
            values[j] = $w('quantity_'+products[i]).value;
            products_id[j] = products[i];
            j++;
        }

        req.open(null, '/js/_ajax/basket/recount.php', true);
        var data = {
            'sid': sid, 
            'products_id': products_id, 
            'values': values
        };
        req.send(data);

        mes.loading('Перерасчет количества товаров и суммы заказа');

        req.onreadystatechange = function(){
            //$w('debug').innerHTML = req.responseText;
            if (req.readyState == 4) {

                var quantity = req.responseJS.quantity;
                var total_price = req.responseJS.total_price;
                var total_prices = req.responseJS.new_prices;
                var product_prices = req.responseJS.product_prices;
                //if ($w('delivery_type')!=null) var delivery = $w('delivery_type').value;

                if (quantity>0) {
                    if ($w('t_price')!=null) $w('t_price').innerHTML = total_price+'';
                    //$w('price_delivery').innerHTML = total_price+'';
                    if ($w('empty_shopping_cart')) $w('empty_shopping_cart').style.display = 'none';
                    if ($w('shopping_cart')) $w('shopping_cart').style.display = '';
                    if ($w('quantity')) $w('quantity').innerHTML = quantity;
                    if ($w('total_price')) $w('total_price').innerHTML = total_price;
                    if ($w('ending')) $w('ending').innerHTML = req.responseJS.end;
                    //if (delivery>0) choose_delivery_type(delivery);
                    if (products.length>0)
                        for (i = 0; i<products.length; i++) if ($w('price_'+products[i])!=null && total_prices[k]) {
                            if (total_prices[k]>0) $w('price_'+products[i]).innerHTML = product_prices[k];
                            if ($w('summa_'+products[i])!=null) $w('summa_'+products[i]).innerHTML = total_prices[k];
                            k++;
                        }

                }

                mes.show();

            }
        }
    }
}

// проверка на введенное количество
function CheckQuantities(){

    var ids = new Array();
    if ($w('recount_ids')!=null) ids = $w('recount_ids').value.split(',');

    if (ids.length > 0) {
        for (var i = 0; i < ids.length; i++) if ($w('quantity_'+ids[i])!=null) {

            inp = $w('quantity_'+ids[i]);
            var value = inp.value;

            if ((isNaN(parseInt(value, 10)) ) || (parseInt(value,10)<=0)) {
                mes.show('info','Кол-во товара должно быть больше нуля!', 'quantity_'+ids[i]);
                inp.value = 1;
                return 0;
            }
        }
        return 1;
    }
}

// ****************************************** //
// ****** КОРЗИНА ПОЛЬЗОВАТЕЛЯ >>>>>   ****** //
// ****************************************** //



function removeElement(parent_name,child_name) {
    if ($w(parent_name) && $w(child_name)) {
        var d = $w(parent_name);
        var olddiv = $w(child_name);
        d.removeChild(olddiv);
    }
}



// перерисовка страницы
function reloadPage() {
    document.body.style.display="inline";
    document.body.style.display="block";
}



////////////////////////////////////
// <<<<<ДИНАМ. ИЗМЕН. СОДЕРЖИМОГО //
////////////////////////////////////

function change_content(id, path, parent_name){
    var content = $w(parent_name);

    if (content!=null) {

        mes.loading('Загрузка данных');

        var req = new JsHttpRequest();
        req.open(null, '/js/_ajax/change_content.php', true);
        var data = {
            'id': id, 
            'path': path, 
            'module': parent_name
        };
        req.send(data);

        req.onreadystatechange = function() {
            //		if (req.responseText) $w('debug').innerHTML = req.responseText;

            if (req.readyState == 4) {

                //**** СОДЕРЖИМОЕ ****//
                var html = req.responseJS.html;
                content.innerHTML = (html) ? html : '';

                //**** ЗАГОЛОВОК СТРАНИЦЫ ****//
                document.title = req.responseJS.MetaTitle;

                //**** НАВИГАЦИОННАЯ ЛИНИЯ ****//
                //var navigationLine = req.responseJS.navigationLine;
                //if (navigationLine && $w('navigation')!=null) $w('navigation').innerHTML = navigationLine;
                //**** МЕНЮ САЙТА ****//
                //var menu = req.responseJS.menu;
                //if (menu && $w('menu')!=null) $w('menu').innerHTML = menu;
                mes.show();
                reloadPage();
                location.href = '#'+parent_name;
            }


        }
    } else if (path) location.href = ''+path+'';
}
////////////////////////////////////
// ДИНАМ. ИЗМЕН. СОДЕРЖИМОГО>>>>> //
////////////////////////////////////


function check_all(e,Name,cookie_name,action,group){
    thisCheckBoxes = e.parentNode.parentNode.parentNode.getElementsByTagName('input');
    var add_values = '';
    var del_values = '';
    for (i = 1; i < thisCheckBoxes.length; i++)
        if (thisCheckBoxes[i].name == Name){
            thisCheckBoxes[i].checked = e.checked;
            if (thisCheckBoxes[i].checked==true) add_values += thisCheckBoxes[i].value+',';
            else del_values += thisCheckBoxes[i].value+',';
        }

    if (action == 'save' && cookie_name!=undefined) {
        if (group!=undefined) resetCookie(cookie_name,group);
        if (add_values) saveCookieValues(cookie_name, add_values.substring(0,add_values.length-1), 1);
        if (del_values) delCookieValues(cookie_name, del_values.substring(0,del_values.length-1), 1);
    }
}


function check_one(e,cookie_name,action,group){
    //if ($w(e.id.replace('chb','str'))) {e.checked = !e.checked;}
    if (action == 'save' && cookie_name!=undefined){
        if (group!=undefined) resetCookie(cookie_name,group);
        if (e.checked == true) saveCookieValues(cookie_name, e.value, 1);
        else delCookieValues(cookie_name, e.value, 1);
    }
}



function compare_checked(){
    var p_ids = new Array();
    var result = false;

    var compare = getCookie('compare');
    if (compare != null && compare != '') var p_ids = compare.split(',');

    if (p_ids.length>1) result = true;
    else if (p_ids.length==1) mes.show('info', 'Для того чтобы сравнить, необходимо выбрать не менее двух товаров!');
    else mes.show('info', 'Отметьте позиции, которые Вы хотите сравнить!');

    return result;
}



////////////////////////////
// <<<<< РАБОТА С COOKIE  //
////////////////////////////
/*function addCookie(szName,szValue,dtDaysExpires,cPath,url)
{        
   $.ajax({
       url:'/js/_ajax/cookie.php',
       data:{act:'add', name:szName, value:szValue, expire:dtDaysExpires, path:cPath},
       type:'post',
       success:function(data){           
           if (url == 'reload')
               location.reload();
           else if(url)
               location.href = url;           
       }
   });       
}*/

function addCookie (name, value, expires, path, domain, secure) {
    var reload = false;
    var href = false;

    if(domain == 'reload') reload = true;
    else if(domain) {
        href = true;
        url = domain;
    }

    var domain = 'veho.ru';
    document.cookie = name + "=" + escape(value) +
    ((expires) ? "; expires=" + expires : "") +
    ((path) ? "; path=" + path : "") +
    ((domain) ? "; domain=" + domain : "") +
    ((secure) ? "; secure" : "");
    if (reload) location.reload();
    else if(href) location.href = url;         
}

function getCookie(name) {
    var prefix = name + "="
    var cookieStartIndex = document.cookie.indexOf(prefix)
    if (cookieStartIndex == -1) return null
    var cookieEndIndex = document.cookie.indexOf(";", cookieStartIndex + prefix.length)
    if (cookieEndIndex == -1) cookieEndIndex = document.cookie.length
    return unescape(document.cookie.substring(cookieStartIndex + prefix.length, cookieEndIndex))
}

function deleteCookie(name, path, domain) {
    if (path==undefined) path = '/';
    if (getCookie(name)) {
        document.cookie = name + "=" +
        ((path) ? "; path=" + path : "") +
        ((domain) ? "; domain=" + domain : "") +
        "; expires=Thu, 01-Jan-70 00:00:01 GMT"
    }
}

function saveCookieValues(cookie_name, new_values, period, path, circle){
    if (!new_values) return false;
    if (period==undefined) period = 1;
    if (path==undefined) path = '/';
    if (circle==undefined) circle = 0;
    else circle = parseInt(circle);

    var checked_values = {};
    var cookie_value = getCookie(cookie_name);
    if (cookie_value == null || cookie_value == '') addCookie(cookie_name, new_values, period, path);
    else {
        var values = (cookie_value+','+new_values).split(',');
        var save_values = '';
        var from = (circle>0 && values.length>circle) ? values.length-circle : 0;
        if (values.length > 0) for (var i=from; i<values.length; i++) if (values[i]>0 && !checked_values['id'+values[i]]) {
            save_values += values[i]+',';
            checked_values['id'+values[i]] = 1;
        }
        if (save_values) {
            save_values = save_values.substring(0,save_values.length-1);
            addCookie(cookie_name, save_values, period, path);
        }
    }
}

function delCookieValues(cookie_name, del_values, period, path){
    if (!del_values) return false;
    if (period==undefined) period = 1;
    if (path==undefined) path = '/';

    var checked_values = {};
    var cookie_value = getCookie(cookie_name);

    if (cookie_value != null && cookie_value != '') {
        del_values = del_values.split(',');
        if (del_values.length>0) for (var i=0; i<del_values.length; i++) checked_values['id'+del_values[i]] = 1;

        var values = cookie_value.split(',');
        var save_values = '';
        if (values.length > 0) for (var i=0; i<values.length; i++) if (values[i]>0 && !checked_values['id'+values[i]]) {
            save_values += values[i]+',';
            checked_values['id'+values[i]] = 1;
        }
        if (save_values) save_values = save_values.substring(0,save_values.length-1);
        addCookie(cookie_name, save_values, period, path);
    }
}

function resetCookie(cookie_name,group,period, path){
    if (group==undefined) return false;
    if (period==undefined) period = 1;
    if (path==undefined) path = '/';

    var value = getCookie(cookie_name+'_group');
    //alert(value + ' == ' + group);
    if (value!=null && value!=group) {
        addCookie(cookie_name,'',period,path);
    }
    addCookie(cookie_name+'_group',group,period,path);



}
////////////////////////////
// РАБОТА С COOKIE >>>>>> //
////////////////////////////



// УДАЛЕНИЕ ФАЙЛА
function delete_photo(name, dir){
    remove_func = new Function("remove_photo('"+name+"', '"+dir+"');");
    mes.show('confirm','Вы действительно хотите удалить файл?');
}

function remove_photo(name, dir) {
    var req = new JsHttpRequest();
    req.open(null, '/js/_ajax/remove_photo.php', true);

    var data = {
        'name': name, 
        'dir': dir
    };
    req.send(data);

    mes.loading('Удаление файла');

    req.onreadystatechange = function() {
        if (req.readyState == 4) {

            var status = req.responseJS.status;
            if (status == true) {
                //$w('avatar_image_yes').style.display = 'none';
                $w('avatar_image').innerHTML = 'Аватaр удален';
                mes.show('info','Файл успешно удален');
                return true;
            } else {
                mes.show('error','Невозможно удалить файл, <a href="/box/error_message/__user__edit__/" rel="gb_page_center[600, 320]" title="Форма отправки сообщений">Написать администратору</a>');
                return false;
            }


            mes.show();
        }
    }
}





// ***************************************** //
// *****  <<<<<< Работа с формами   ******** //
// ***************************************** //
var errs = new Array();
var ie=document.all
var ns6=document.getElementById&&!document.all

function imgFormClick (el,val) {
    if ((ie||ns6) && $w(el)) {
        rad_value = $w(el).value;

        if (val > 0) new_value = val;
        else if (val == 'x') new_value = rad_value;
        else new_value = rad_value == 1? '2': '1';

        new_text_value = '';

        var path=$w(el+'_img').src;
        var regexp =/_.\./g;
        path = path.replace(regexp,'_'+new_value+'.');
        $w(el+'_img').src=path;
        $w(el+'_img').alt = new_text_value;
        $w(el).value = new_value;
    }
}

function FormCheckInt (el,id,showerr,elfocus,errmsg) {
    if ((ie||ns6) && el && $w('f'+id)) {
        value = el.value;
        if (!(/^(\d{1,3})$/.test(value))) {
            el.className = 'inp_text_err';
            errs[id] = 1;
            if (showerr == 1) {
                $w('f'+id).innerHTML = errmsg;
            }
            if (elfocus == 1) {
                el.focus();
            }
        }
        else if ((errs[id] == 1 && errmsg.toLowerCase() == $w('f'+id).innerHTML.toLowerCase()) || !errs[id]) {

            $w('f'+id).innerHTML = '';
            el.className = 'inp_text_hover';
            errs[id] = 0;
            if (elfocus == 1) {
                el.focus();
            }
        }
    }
}

function change_class(e,class_name){
    if (e!=null && e.value!='') e.className =(class_name != undefined) ? class_name : 'inp_text';
}

function FormCheckEmail(id, user_id){
    var e = $w(id);
    if (e!=null) {
        if (e.value=='') mes.show('error', 'Необходимо ввести email адрес', e.id);
        else if (/^[\w\-\.]{2,32}\@[\w\-\.]+\.[a-zA-Z0-9]{2,5}$/i.test(e.value)==false) mes.show('error', 'Некорректно введен email адрес', e.id);
        else if (FormCheckLogin(e, 'Email', user_id, 'Необходимо ввести email адрес', 'Введенный email адрес уже существует')) return true;
    } else mes.show('error', 'Неверно указан елемент');

    return false;
}


function FormCheckLogin(e, name, user_id, errtext1, errtext2) {

    var value = e.value;
    if (value=='') {
        mes.show('error', errtext1, e.id);
        return false;
    }
    else {
        if (name=='Name' && $w('Email').type == 'text'){
            if (/^[\w-\.]{2,64}$/i.test(value)==false) {
                mes.show('error', 'Некорректно введено имя пользователя', e.id);
                return false;
            }
            else if (/admin|root|support/i.test(value)==true) {
                mes.show('error', 'В имени пользователя найдены запрещенные слова, попробуйте другой логин', e.id);
                return false;
            }
        }

        var req = new JsHttpRequest();
        req.open(null, '/js/_ajax/user/check_regname.php', true);
        var data = {
            'Name': name, 
            'Value': value, 
            'UserID': user_id
        };
        req.send(data);

        req.onreadystatechange = function() {
            if (req.readyState == 4) if (req.responseJS.status>0) mes.show('error', errtext2, e.id);
        }

    }

}



function FormCheckName (el,id,showerr,elfocus,errmsg) {
    if ((ie||ns6) && el && $w('f'+id)) {
        value = el.value;
        if (/[\||\'|\<|\>|\"|\!|\$|\@|\&\~\*\+]/.test(value)) {
            el.className = 'inp_text_err';
            errs[id] = 1;
            if (showerr == 1) {
                $w('f'+id).innerHTML = errmsg;
            }
            if (elfocus == 1) {
                el.focus();
            }
        }
        else if ((errs[id] == 1 && errmsg.toLowerCase() == $w('f'+id).innerHTML.toLowerCase()) || !errs[id]) {

            $w('f'+id).innerHTML = '';
            el.className = 'inp_text_hover';
            errs[id] = 0;
            if (elfocus == 1) {
                el.focus();
            }
        }
    }
}

function FormCheckEmpty (el,id,len,showerr,elfocus,errmsg) {
    if ((ie||ns6) && el && $w('f'+id)) {
        value = el.value;
        if (el.value.replace(/ /gi,"").length < len) {
            el.className = 'inp_text_err';
            errs[id] = 1;
            if (showerr == 1) {
                $w('f'+id).innerHTML = errmsg;
            }
            if (elfocus == 1) {
                el.focus();
            }
        }
        else if ((errs[id] == 1 && errmsg.toLowerCase() == $w('f'+id).innerHTML.toLowerCase()) || !errs[id]) {
            $w('f'+id).innerHTML = '';
            el.className = 'inp_text_hover';
            errs[id] = 0;
            if (elfocus == 1) {
                el.focus();
            }
        }
    }
}


function CheckForm ( type, el, id, showerr, elfocus, errmsg )
{
    if (type==undefined||type==null) type = 'empty';
    alert(type[0]);
    if ((ie||ns6)&&el)
    {
        var value=el.value.trim();
        var regexp=null;

        switch (type)
        {
            case 'int':
                regexp = /^(\d{1,3})$/;
                break;
        }
    }
}

/*
 *Блок работы с формами
 */
function change_class(e,class_name){
    if (e!=null && e.value!='') e.className =(class_name != undefined) ? class_name : 'inp_text';
}
function check_form_errors(form_id){ 
    //alert("check_form_errors");          
    /*for (var key in valid.config.timer) {
  var val = valid.config.timer[key];
  if val = 
}*/    
    var t = eval('checkFields_'+form_id);
        
    var mas = (t) ? t : null;
    if (!mas) return false;       
    var result = true;
    var focus_id = '';
    for (var i in mas)
        if ($w(i)){                                             
            $('#'+i).blur().after(function(){                            
                if($('#'+i).attr('class') == 'inp_text_err'
                    || $('#'+i+'Mes').attr('class') == 'incorrect' 
                    || $('#'+i+'Mes').attr('class') == 'inp_text_ajax'){
                    if (focus_id=='' && result == true) focus_id = '#'+i;  
                    result = false;
                }
            });
        }                                        
    if (focus_id) $(focus_id).focus();
    return result;
}

function check_ajax_data(form_name,form_id,act){ 
    var myResult = true;
    if (form_name==undefined) form_name = '';
    if (form_id==undefined) form_id = '';
    if (act==undefined) act = '';
    
    var fdata = $w(form_name+form_id);
    var focus_id = '';
    if (fdata.length>0) {
        for (var i=0; i<fdata.length; i++) if (fdata[i].id) {
            if (act=='blur') $('#'+fdata[i].id).blur();
            if(($('#'+fdata[i].id).attr('class') == 'inp_text_err'
                || $('#'+fdata[i].id+'Mes').attr('class') == 'incorrect' 
                || $('#'+fdata[i].id+'Mes').attr('class') == 'ajax') && $w(fdata[i].id+'Mes')){
                if (focus_id=='' && myResult == true) focus_id = '#'+fdata[i].id;
                myResult = false;   
            } 
        } 
    }else myResult = false;
    if (focus_id) $(focus_id).focus();

    if (myResult){                
        switch(form_name){            
            case 'form_data':
                form_data(form_id);
                break;
            case 'reg_form':
                load_registration();
                break;
        }
    
    } else setTimeout("check_ajax_data('"+form_name+"','"+form_id+"')", 200);   
}

// Отправка данных из модуля формы
function form_data(form_id){
    var fdata = $w('form_data'+form_id);

    var fields_value = new Array(fdata.length);
    for (var i=0; i<fdata.length; i++) fields_value[fdata.elements[i].name] = fdata.elements[i];
    fields_value['page'] = location.href;

    var req = new JsHttpRequest();
    req.open(null, '/js/_ajax/messages/send_form_data.php', true);
    var data = {
        'form_id': form_id, 
        'data': fields_value, 
        'back_link' : eval('back_link'+form_id)
    };
    req.send(data);

    if(form_id != '5')
        mes.loading('Отправление данных');
    else {
        $('#jal_1').css('display','none'); 
        $('#jal_2').css('display','block'); 
    }

    req.onreadystatechange = function() {
        //	  $w('debug').innerHTML = req.responseText;
        if (req.readyState == 4) {

            var message = req.responseJS.result;
            var errors = req.responseJS.errors;
            var focus = req.responseJS.focus;

            if (errors != '') mes.show('error', errors, focus);
            else {

                if(form_id != '5'){
                    if (message) {
                        mes.show('info', message);
	        	
                        if ($w('iCodeForm'+form_id)) reImg('iCodeForm'+form_id);
                        valid.clearForm('form_data'+form_id);
                    }
                    else mes.show();
                }
                else {
                    $('#jal_2').css('display','none'); 
                    $('#jal_3').css('display','block'); 	
                }
            }

        }
    }
}


// 
function send_form_data(form_id, form_name){    
    if (form_name == undefined) form_name = 'form_data';    
    if (check_form_errors(form_id)==true) setTimeout("check_ajax_data('"+form_name+"','"+form_id+"','blur')",200);
}

function reImg(id){
    if ($w(id)==null) return false;
    var ndate = new Date().getTime();
    $w(id).src = "/inc/Modules/antibot.php?" + ndate;
}


// ***************************************** //
// ******* Работа с формами >>>>>>> ******** //
// ***************************************** //

function print_page(){
    if (typeof(window.print) != undefined) {
        window.print();
    }
}



/* ЗАГРУЗИТЬ КАРТИНКУ */
function Preload(imgObj,imgSrc) {
    if (document.images) {
        eval(imgObj+' = new Image()')
        eval(imgObj+'.src = "'+imgSrc+'"')
    }
}



////////////////////////////
// <<<<< DRAG AND DROP    //
////////////////////////////
var dflag=false;
var shift_x;
var shift_y;

function start_drag(itemToMove,e){
    if(!e) e = window.event;
    itemToMove.style.cursor='move';
    dflag=true;
    shift_x = e.clientX-parseInt(itemToMove.style.left);
    shift_y = e.clientY-parseInt(itemToMove.style.top);

    if(e.stopPropagation) e.stopPropagation();
    else e.cancelBubble = true;
    if(e.preventDefault) e.preventDefault();
    else e.returnValue = false;
}

function end_drag(){
    dflag=false;
}

function dragIt(itemToMove,e){
    if(!dflag) {
        itemToMove.style.cursor='default';
        addCookie('left',parseInt(itemToMove.style.top),30,'/');
        addCookie('top',parseInt(itemToMove.style.left),30,'/');
        return;
    }
    if(!e) e = window.event;
    itemToMove.style.left = (e.clientX-shift_x) + "px";
    itemToMove.style.top = (e.clientY-shift_y) + "px";

    if(e.stopPropagation) e.stopPropagation();
    else e.cancelBubble = true;
    if(e.preventDefault) e.preventDefault();
    else e.returnValue = false;
}


function r_over(e){
    e.style.color = '#66ccff';
    e.style.fontWeight = 'bold';
}
function r_out(e){
    e.style.color = '#333';
    e.style.fontWeight = 'normal';
}

////////////////////////////
// DRAG AND DROP   >>>>>> //
////////////////////////////

////////////////////////////
// <<<<<<< LOGIN		  //
////////////////////////////
function time(m){
    m--;
    if ( m >= 0) {
        if (document.getElementById('user_enter')) document.getElementById('user_enter').style.display = 'none';
        document.getElementById('wait_time').style.display = '';
        document.getElementById('login_name').disabled = true;
        document.getElementById('login_passwd').disabled = true;
        if (document.getElementById('remember')) document.getElementById('remember').disabled = true;
        document.getElementById('timer').innerHTML = m;

    }
    else {
        if (document.getElementById('user_enter')) document.getElementById('user_enter').style.display = '';
        document.getElementById('wait_time').style.display = 'none';
        document.getElementById('login_passwd').value = '';
        document.getElementById('login_name').disabled = false;
        document.getElementById('login_passwd').disabled = false;
        if (document.getElementById('remember')) document.getElementById('remember').disabled = false;
        return false;
    }

    setTimeout("time("+m+")",1000);
}


function user_login(name, pass, remember){
	
	var auto_login_after_registration;
	
	auto_login_after_registration = (name && pass) ? true: false;
	
	
    if ($w('wait_time') && $w('wait_time').style.display == '') mes.show('error','Доступ временно заблокирован');	
    else if (!$w('login_name').value && !(name && pass)) mes.show('error','Необходимо ввести электронную почту и пароль', 'login_name');
    else {		
        var req = new JsHttpRequest();
        req.open(null, '/js/_ajax/user/login.php', true);		
		if(!name)
			var name = $w('login_name').value;
		if(!pass)			
			var pass = $w('login_passwd').value;
		if(!remember)
			if ($w('remember')) var remember = $w('remember').checked;		
        var data = {
            'name': name, 
            'pass' : pass, 
            'remember': remember
        };
        req.send(data);

        $w('loading-text').style.textAlign = 'center';
        mes.loading('Проверка введенных данных');

        req.onreadystatechange = function() {

            //$w('debug').innerHTML = req.responseText;

            if (req.readyState == 4) {
                if (req.responseJS.error != 'no') {

					if(auto_login_after_registration) return false;
                    $w('loading-text').style.textAlign = 'left';
                    mes.show('error', req.responseJS.error , 'login_passwd');
                    if (req.responseJS.disabled != 0 ) {
                        $w('user_enter').style.display = 'none';
                        $w('login_name').disabled = true;
                        $w('login_passwd').disabled = true;
                        time(req.responseJS.disabled);						
                    }
                    else {
                        $w('user_enter').style.display = '';
                        $w('login_passwd').value = '';
                        $w('login_name').disabled = false;
                        $w('login_passwd').disabled = false;						
                    }
                    return false;
                }				

                $w('loading-text').style.textAlign = 'center';
                mes.show();                        
                $w('login_form').submit();
            }
        }


    }
}
////////////////////////////
// LOGIN		  >>>>>>  //
////////////////////////////

var formats = {
    'search': function(e){
        var val = e.value;
        val = val.replace(/[\"\'\.\&\|]/ig, "");
        e.value = val;
        return val;
    }
}

/// телефонный формат +7 (***) *******
function setPhoneFormat(e,event){
    var k = event.keyCode;
    if (k != 8 && k != 46){
        var val = e.value;
        val = val.replace(/[^0-9]/g, "");
        var pattern = /\(?([0-9]{3})\)?\ ?([0-9]{0,7})?/;
        if (pattern.test(val)) val = '('+RegExp.$1+') '+RegExp.$2;
        e.value = val;
    }
}

//// денежный формат
function format_cost(e){
    var val = set_money_format(e.value);
    e.value = val;
}

function set_money_format(num){
    if (num == undefined) return;
    var val = new String(num);
    var new_value = '';
    if (val.length>0) {
        val = val.replace(/[^0-9]/g, "");
        var j = 0;
        if (val.length>=3){
            for (var i=val.length-1; i>=0; i--) {
                j++;
                new_value = val.charAt(i)+new_value;
                if (j%3==0) new_value = ' '+new_value;
            }
        } else new_value = val;
        new_value = trim(new_value);

    } else new_value = val;

    return new_value;
}

function currRound(value) {
    return (parseInt(value * 100) / 100).toFixed(0);
}


// Функция trim удаляет пробелы
// в начале и в конце строки
function trim(str, chars) {
    return ltrim(rtrim(str, chars), chars);
}

function ltrim(str, chars) {
    chars = chars || "\\s";
    return str.replace(new RegExp("^[" + chars + "]+", "g"), "");
}

function rtrim(str, chars) {
    chars = chars || "\\s";
    return str.replace(new RegExp("[" + chars + "]+$", "g"), "");
}

/* Ratings */
var rat = {
    id: 0, 
    yes: null, 
    no: null,
    cName: function(e,val,cur){
        if (cur==undefined && e.style.cursor!='pointer') e.style.cursor = 'pointer';
        else if (cur!=undefined) e.style.cursor = cur;
        e.className = val;
    },
    get_ip: function(e){
        var els = e.parentNode.getElementsByTagName('div');
        var cid = els[0].id;
        this.yes = els[1];
        this.no = els[2];
        this.id = parseInt(cid.substring(5,cid.length));
    },
    reset: function(){
        this.yes.onclick = null;
        this.yes.onmouseover = null;
        this.yes.onmouseout = null;
        this.no.onclick = null;
        this.no.onmouseover = null;
        this.no.onmouseout = null;
    },
    vote: function(e,val){
        this.get_ip(e);
        if (!this.id || !$w('vote_'+this.id)) {
            mes.show('error', 'Сервис не доступен, обратитесь к администратору');
            return false;
        }
        this.reset();
        var req = new JsHttpRequest();
        req.open(null, '/js/_ajax/ratings/create_ocenka.php', true);
        var data = {
            'comment_id': this.id, 
            'value': val
        };
        req.send(data);

        req.onreadystatechange = function() {
            //if (req.responseText) $w('debug').innerHTML = req.responseText;
            if (req.readyState == 4) {

                var result = req.responseJS.result;
                var errors = req.responseJS.errors;
                var cName = req.responseJS.cName;

                if (errors) mes.show('error', errors);
                else {
                    if ($w('vote_'+rat.id)) {
                        if (result) $w('vote_'+rat.id).innerHTML = result;
                        if (cName) $w('vote_'+rat.id).className = cName;
                    }
                }

            }
        }
    },
    create: function(vote,id_num,module_id,ip_num,units,template){
        if (template == undefined) template = '';
        var theUL = $w('unit_ul'+id_num);
        theUL.innerHTML = '<div class="rating_loading"></div>';

        var req = new JsHttpRequest();
        req.open(null, '/js/_ajax/ratings/create_rating.php', true);
        var data = {
            'j': vote, 
            'q': id_num, 
            'm': module_id, 
            't' : ip_num, 
            'c' : units, 
            'templ': template
        };
        req.send(data);

        req.onreadystatechange = function() {
            //if (req.responseText) $w('debug').innerHTML = req.responseText;
            if (req.readyState == 4) {

                var result = req.responseJS.result;
                var errors = req.responseJS.errors;

                if (errors) mes.show('error', errors);
                else {
                    $w('unit_long'+id_num).innerHTML = result;
                }

            }
        }

    }
}


function moveCaretToStart(inputObject)
{
    if (inputObject.selectionStart)
    {
        inputObject.setSelectionRange(0,0);
        inputObject.focus();
    }
}
function moveCaretToEnd(inputObject)
{
    if (inputObject.selectionStart)
    {
        var end = inputObject.value.length;
        inputObject.setSelectionRange(end,end);
        inputObject.focus();
    }
}

/*
Array.shuffle( deep ) - перемешать элементы массива случайным образом
var a = new Array(1,2,3,4,5);
alert( a.shuffle() );
alert( ['a','b','c', [1,2,3,4,5], 'D','E','F'].shuffle(true) );

Array.prototype.shuffle = function( b )
{
 var i = this.length, j, t;
 while( i )
 {
  j = Math.floor( ( i-- ) * Math.random() );
  t = b && typeof this[i].shuffle!=='undefined' ? this[i].shuffle() : this[i];
  this[i] = this[j];
  this[j] = t;
 }

 return this;
};
*/


function get_textarea_value(id,type){
    if (!tinyMCE) var tinyMCE = {
        'editors': {}
    };
    if (type==undefined || !type)
        return ((id!=undefined && tinyMCE && tinyMCE.editors[id]!=undefined) ? trim(tinyMCE.editors[id].getContent($w(id)).replace(/(\<\/?[^\>]+\>)|(\&nbsp\;)|(\r?\n)/gi,"")) : ($w(id)?$w(id).value:''));
    else return ((id!=undefined && tinyMCE && tinyMCE.editors[id]!=undefined) ? tinyMCE.editors[id].getContent($w(id)) : ($w(id)?$w(id).value:''));
}

/* comments */
var com = {
    temp: '',
    setParent: function(comment_id){
        if (comment_id==undefined || comment_id == 0) $w('commentParent').value = 0;
        else {
            $w('commentParent').value = comment_id;
        //	if ($w('commentText')) moveCaretToStart($w('commentText'));
        }
        $('#CommentBlock').slideDown('slow');
    //$w('commentText').focus();
    },
    create: function(){
        var result = false;
        var user_name = $w('author_name') ? $w('author_name').value : '';
        var user_email = $w('user_email') ? $w('user_email').value : '';
        var comment_strip_tags = get_textarea_value('commentText');
        var comment = get_textarea_value('commentText','value');
        var code = $w('commentCode') ? $w('commentCode').value : '';
        var check_code = $w('commentCode') ? 2 : 1;
        var parent_id = $w('commentParent').value;

        if (user_name == '' && $w('author_name')) mes.show('error', 'Необходимо ввести ваше имя', 'author_name');
        else if (user_email == '' && $w('user_email')) mes.show('error', 'Необходимо указать ваш email', 'user_email');
        else if ($w('user_email') && /^[\w\-\.]+\@[\w\-\.]+\.[a-z]{2,5}$/i.test(user_email)==false) mes.show('error', 'Email адрес указан некорректно', 'user_email');
        else if (comment_strip_tags == '') mes.show('error', 'Необходимо написать содержание', 'commentText');
        else if (comment_strip_tags.length<5) mes.show('error', 'Содержание должно быть длинее', 'commentText');
        else {
            var req = new JsHttpRequest();
            req.open(null, '/js/_ajax/comments/create_comment.php', true);
            var data = {
                'comment': comment, 
                'user_name': user_name, 
                'user_email': user_email, 
                'parent_id' : parent_id, 
                'module': $w('module').value, 
                'mod_id': $w('mod_id').value, 
                'check_code' : check_code, 
                'code': code
            };
            req.send(data);

            mes.loading();

            req.onreadystatechange = function() {
                //if (req.responseText) $w('debug').innerHTML = req.responseText;
                if (req.readyState == 4) {

                    var message = req.responseJS.result;
                    var errors = req.responseJS.errors;
                    var focus = req.responseJS.focus;
                    var mes_delay = req.responseJS.delay;

                    if (errors != '') {
                        if (focus) mes.show('error', errors, focus); else mes.show('error', errors);
                    }
                    else {
                        if (message) {
                            mes.show('info', message);
                            if ($w('author_name')) $w('author_name').value = '';
                            if ($w('user_email')) $w('user_email').value = '';
                            $w('commentText').value = '';
                            if ($w('commentCode')) $w('commentCode').value = '';
                            reImg('commentCode');
                            var href = location.href.replace(/\#.*/,"")+(parent_id>0?'#comment_'+parent_id:'#add_comment');
                            setTimeout("location.href = \'"+href+"\'; location.reload();",mes_delay);
                        //setTimeout("location.reload();",mes_delay);
                        }
                        else mes.show();
                    }

                }

            }

            result = true;
        }

        return result;
    }
}


/* Players */
var players = {};
function show_player(id){
    if (!$w(id)) return false;
    close_player();
    showShadow();
    var top = (document.body.scrollTop>0) ? document.body.scrollTop : document.documentElement.scrollTop;
    if (self.screen) $w(id).style.top = (parseInt(top,10)+(screen.height/2)-300)+'px';
    else $w(id).style.top = (parseInt(top,10)+(document.body.clientHeight/2)-90)+'px';
    $w(id).style.left = ((document.body.clientWidth/2)-250)+'px';
    $w(id).style.display = '';
    players[id] = 'none';

}

function close_player(win){
    if (isIE && win == true) location.reload();
    hideShadow();
    for(var i in players) if ($w(i)) {
        $w(i).style.display = players[i];
        delete players[i];
    }
}



/* SHOWHINT */
var horizontal_offset="30px"
var vertical_offset="0"
var ie=document.all
var ns6=document.getElementById&&!document.all
var dropmenuobj = null;

function getposOffset(what, offsettype){
    var totaloffset=(offsettype=="left")? what.offsetLeft : what.offsetTop;
    var parentEl=what.offsetParent;
    while (parentEl!=null){
        totaloffset=(offsettype=="left")? totaloffset+parentEl.offsetLeft : totaloffset+parentEl.offsetTop;
        parentEl=parentEl.offsetParent;
    }
    return totaloffset;
}

function iecompattest(){
    return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
}

function clearbrowseredge(obj, whichedge){
    var edgeoffset=(whichedge=="rightedge")? parseInt(horizontal_offset)*-1 : parseInt(vertical_offset)*-1
    if (whichedge=="rightedge"){
        var windowedge=ie && !window.opera? iecompattest().scrollLeft+iecompattest().clientWidth-30 : window.pageXOffset+window.innerWidth-40
        dropmenuobj.contentmeasure=dropmenuobj.offsetWidth
        if (windowedge-dropmenuobj.x < dropmenuobj.contentmeasure)
            edgeoffset=dropmenuobj.contentmeasure+obj.offsetWidth+parseInt(horizontal_offset)
    }
    else{
        var windowedge=ie && !window.opera? iecompattest().scrollTop+iecompattest().clientHeight-15 : window.pageYOffset+window.innerHeight-18
        dropmenuobj.contentmeasure=dropmenuobj.offsetHeight
        if (windowedge-dropmenuobj.y < dropmenuobj.contentmeasure)
            edgeoffset=dropmenuobj.contentmeasure-obj.offsetHeight
    }
    return edgeoffset
}

function showhint(menucontents, obj, e, tipwidth, hide_action, topstep, leftstep){
    if (hide_action==undefined) hide_action = true;
    if (leftstep == undefined) leftstep = -8;
    if (tipwidth==undefined || tipwidth == '' || !tipwidth) tipwidth = 'auto';
    if (topstep==undefined) topstep = 0;
    if ((ie||ns6) && document.getElementById("hintbox")){
        dropmenuobj=document.getElementById("hintbox")
        dropmenuobj.style.display = '';
        document.getElementById('hint_cont').innerHTML=menucontents
        dropmenuobj.style.left=dropmenuobj.style.top=-500
        if (tipwidth!=""){
            dropmenuobj.widthobj=dropmenuobj.style
            dropmenuobj.widthobj.width=tipwidth
        }
        dropmenuobj.x=getposOffset(obj, "left")
        dropmenuobj.y=getposOffset(obj, "top")
        dropmenuobj.style.left=dropmenuobj.x-clearbrowseredge(obj, "rightedge")+obj.offsetWidth-leftstep-$("#wrap").offset().left +"px"
        dropmenuobj.style.top=dropmenuobj.y-clearbrowseredge(obj, "bottomedge")-topstep+"px"
        dropmenuobj.style.visibility="visible"
        if (hide_action) obj.onmouseout=hidetip
    }
}

function hidetip(e){
    if (dropmenuobj!=null && dropmenuobj!=undefined){
        dropmenuobj.style.visibility="hidden"
        dropmenuobj.style.left="-500px"
        dropmenuobj.style.display = '';
    }
}


function isTypeSymbs(e){
    if (e && $w(e.id+'_symbs')) $w(e.id+'_symbs').innerHTML = ''+e.value.length+'';
}
function isMaxCut(e){
    var max_length = e.getAttribute('maxlength');
    if (e.value.length<=max_length) e.value = e.value.substring(0,max_length-1);
    return max_length;
}

function isNotMax(e){
    e = e || window.event;
    var target = e.target || e.srcElement;
    var code=e.keyCode?e.keyCode:(e.which?e.which:e.charCode)
    var max_length = isMaxCut(target);

    switch (code){
        case 13: case 8: case 9: case 46:
        case 37: case 38: case 39: case 40:
            return true;
    }
    if (e.ctrlKey && code != 118) return true;
    return target.value.length <= max_length;
}



/**** CAPTIONS ****/
jQuery.fn.extend({
    captify: function(uo) {
        var o = $.extend({
            speedOver: 'fast',				// speed of the mouseover effect
            speedOut: 'normal',				// speed of the mouseout effect
            hideDelay: 500,					// how long to delay the hiding of the caption after mouseout (ms)
            animation: 'slide',				// 'fade', 'slide', 'always-on'
            prefix: '',						// text/html to be placed at the beginning of every caption
            opacity: '0.45',				// opacity of the caption on mouse over
            className: 'caption-bottom',	// the name of the CSS class to apply to the caption box
            position: 'top',				// position of the caption (top or bottom)
            spanWidth: '100%'				// caption span % of the image
        }, uo);
        $(this).each(function() {
            var img = this;
            $(this).load(function() {
                if (img.hasInit){
                    return false;
                }
                img.hasInit = true;
                var over_caption = false;
                var over_img = false;

                //pull the label from another element if there is a
                //valid element id inside the rel="..." attribute, otherwise,
                //just use the text in the alt="..." attribute.
                var captionLabelSrc = $('#' + $(this).attr('rel'));
                var captionLabelHTML = !captionLabelSrc.length ? $(this).attr('alt') : captionLabelSrc.html();
                captionLabelSrc.remove();
                var toWrap = this.parent && this.parent.tagName == 'a' ? this.parent : $(this);

                var wrapper =
                toWrap.wrap('<div></div>').parent()
                .css({
                    overflow: 'hidden',
                    padding: 0,
                    fontSize: 0.1
                })
                .addClass('caption-wrapper')
                .width($(this).width())
                .height($(this).height());

                //transfer the margin and border properties from the image to the wrapper
                $.map(['top', 'right', 'bottom', 'left'], function(i) {
                    wrapper.css('margin-' + i, $(img).css('margin-' + i));
                    $.map(['style', 'width', 'color'], function(j) {
                        var key = 'border-' + i + '-' + j;
                        wrapper.css(key, $(img).css(key));
                    });
                });
                $(img).css({
                    border: '0 none'
                });

                //create two consecutive divs, one for the semi-transparent background,
                //and other other for the fully-opaque label
                var caption = $('div:last', wrapper.append('<div></div>'))
                .addClass(o.className);

                var captionContent = $('div:last', wrapper.append('<div></div>'))
                .addClass(o.className)
                .append(o.prefix)
                .append(captionLabelHTML);


                //override hiding from CSS, and reset all margins (which could have been inherited)
                $('*', wrapper).css({
                    margin: 0
                }).show();

                //ensure the background is on bottom
                var captionPositioning = jQuery.browser.msie ? 'static' : 'relative';
                caption.css({
                    zIndex: 1,
                    position: captionPositioning,
                    opacity: o.animation == 'fade' ? 0 : o.opacity,
                    width: o.spanWidth
                });

                if (o.position == 'bottom'){
                    var vLabelOffset =
                    parseInt(caption.css('border-top-width').replace('px', '')) +
                    parseInt(captionContent.css('padding-top').replace('px', '')) - 1;
                    captionContent.css('paddingTop', vLabelOffset);
                }
                //clear the backgrounds/borders from the label, and make it fully-opaque
                captionContent.css({
                    position: captionPositioning,
                    zIndex: 2,
                    background: 'none',
                    border: '0 none',
                    opacity: o.animation == 'fade' ? 0 : 1,
                    width: o.spanWidth
                });
                caption.width(captionContent.outerWidth());
                caption.height(captionContent.height());

                // represents caption margin positioning for hide and show states
                var topBorderAdj = o.position == 'bottom' && jQuery.browser.msie ? -4 : 0;
                var captionPosition = o.position == 'top'
                ? {
                    hide: -$(img).height() - caption.outerHeight() - 2, 
                    show: -$(img).height()
                }
                : {
                    hide: 0, 
                    show: -caption.outerHeight() + topBorderAdj
                };

                //pull the label up on top of the background
                captionContent.css('marginTop', -caption.outerHeight());
                caption.css('marginTop', captionPosition[o.animation == 'fade' || (o.animation == 'always-on' || img.alt == 'always-on') ? 'show' : 'hide']);

                //function to push the caption out of view
                var cHide = function() {
                    if (!over_caption && !over_img){
                        var props = o.animation == 'fade'
                        ? {
                            opacity: 0
                        }
                        : {
                            marginTop: captionPosition.hide
                        };
                        caption.animate(props, o.speedOut);
                        if (o.animation == 'fade'){
                            captionContent.animate({
                                opacity: 0
                            }, o.speedOver);
                        }
                    }
                };


                if (o.animation != 'always-on' && img.alt != 'always-on'){
                    //when the mouse is over the image
                    $(this).hover(
                        function() {
                            over_img = true;
                            if (!over_caption) {
                                var props = o.animation == 'fade'
                                ? {
                                    opacity: o.opacity
                                }
                                : {
                                    marginTop: captionPosition.show
                                };
                                caption.animate(props, o.speedOver);
                                if (o.animation == 'fade'){
                                    captionContent.animate({
                                        opacity: 1
                                    }, o.speedOver/2);
                                }
                            }
                        },
                        function() {
                            over_img = false;
                            window.setTimeout(cHide, o.hideDelay);
                        }
                        );
                    //when the mouse is over the caption on top of the image (the caption is a sibling of the image)
                    $('div', wrapper).hover(
                        function() {
                            over_caption = true;
                        },
                        function() {
                            over_caption = false;
                            window.setTimeout(cHide, o.hideDelay);
                        }
                        );
                }
            });
            //if the image has already loaded (due to being cached), force the load function to be called
            if (this.complete || this.naturalWidth > 0) {
                $(img).trigger('load');
            }
        });
    }
});

$(function(){
    $('img.captify').captify({});
});


/* DYNAMIC ELEMENTS */
function create_boxes(){

    $(document.body).append('<div id="loading-box" class="popup-window" style="display: none;" onscroll="end_drag()">'+
        '<div id="loading-size">'+
        '<div id="loading-text"></div>'+
        '<div id="loading-img" style="display: none;"><img src="/_templates/default/cimages/loading/loading.gif" alt="" /></div>'+
        '<div id="loading-actions" style="display: none;"><!--  --></div>'+
        '</div>'+
        '</div>');
    if (isIE) $('.popup-window').css({
        'border': '1px solid #bdbdbd'
    });
    $('#wrap').prepend('<div id="hintbox" class="tooltips prompt" style="display: none;"><div class="bg0"></div><div class="bg" id="hint_cont">'+
        '</div><div class="bg1"><div class="bg2"></div></div></div>');

}

jQuery.preloadImages = function(){
    for(var i = 0; i<arguments.length; i++){
        jQuery("<img>").attr("src", arguments[i]);
    }
};

function load_need_data(){
    var req = new JsHttpRequest();
    req.open(null, '/js/_ajax/load_need_data.php', true);
    var data = {
        'id': cat_id
    };
    req.send(data);

    //mes.loading();

    req.onreadystatechange = function() {
        if (req.responseText) $w('debug').innerHTML = req.responseText;
        if (req.readyState == 4) {

            var message = req.responseJS.result;
            var errors = req.responseJS.errors;
            var focus = req.responseJS.focus;

            if (errors != '') {
                if (focus) mes.show('error', errors, focus); else mes.show('error', errors);
            }
            else {
                // ОКНА
                if (req.responseJS.windows) {
                    $('.windows').html(req.responseJS.windows);

                    /*Начало скриптов по всплывающим окнам*/
                    $('#window_1 .popup_close').click( function () {
                        $('#window_1').css({
                            'display':'none'
                        });
                        $('#popup_bg').animate({
                            'opacity':'hide'
                        } );
                    });
                    $('#forvard_ring .popup_close').click( function () {
                        $('#forvard_ring').css({
                            'display':'none'
                        });
                        $('#popup_bg').animate({
                            'opacity':'hide'
                        });
                    });
                    
                    $('#feedback .popup_close').click( function () {
                        $('#feedback').css({
                            'display':'none'
                        });
                        $('#popup_bg').animate({
                            'opacity':'hide'
                        });
                    });
                    
                    $('#avtorization .popup_close').click( function () {
                        $('#avtorization').css({
                            'display':'none'
                        });
                        $('#popup_bg').animate({
                            'opacity':'hide'
                        });
                    });
                    $('#avtorization .tel_5 a').click( function () {
                        $('#avtorization').css({
                            'display':'none'
                        });
                    });
                    $('#forget_password .popup_close').click( function () {
                        $('#forget_password').css({
                            'display':'none'
                        });
                        $('#popup_bg').animate({
                            'opacity':'hide'
                        });
                    });
                    $('#shopping_cart .popup_close').click( function () {
                        $('#shopping_cart').css({
                            'display':'none'
                        });
                        $('#popup_bg').animate({
                            'opacity':'hide'
                        });
                    });
                    $('#jal_book .popup_close').click( function () {
                        $('#jal_book, #jal_2, #jal_3').css({
                            'display':'none'
                        });
                        $('#jal_1').css({
                            'display':'block'
                        });
                        $('#popup_bg').animate({
                            'opacity':'hide'
                        });
                    })

                    $('#jal_book .mes_sub').click( function () {
                        $('#jal_book, #jal_2, #jal_3').css({
                            'display':'none'
                        });
                        $('#jal_1').css({
                            'display':'block'
                        });
                        $('#popup_bg').animate({
                            'opacity':'hide'
                        });
                    })
                /*Конец скриптов по всплывающим окнам*/
                }
                // CATALOG_MENU
                console.log(req.responseJS.catalog_menu);
                if (req.responseJS.catalog_menu) {
            /*$('.podmenuses').html(req.responseJS.catalog_menu).css({'display':'none'});
                var hidden_podmenu = $('.hidden_podmenu');                               
                var submenus = $('.podmenu');                              
                var submenu_count = submenus.length;                                
                for (var i = 0; i<submenu_count; i++)
                {                                        
                	submenus.eq(i).html(hidden_podmenu.eq(i).html());
                }
				hidden_podmenu.remove();*/
			



            }
            //mes.show();
            }

        }

    }
}

function catalog_timer(first,second) {

    var left_input = $('#inp_beg_1').val();
    var right_input = $('#inp_beg_2').val();
	
    if(first!=left_input || second != right_input) {	
        k_reload_catalog();
        first = left_input;
        second = right_input;
    }
    var t = setTimeout('catalog_timer('+first+','+second+')',1500);
}

//$(window).load
$(document).ready(function(){
    /*<--Сравнение товаров*/
    /*if($('.sravnenie_table').length){
        sravn_table_div();

        $('#open_close_4').click( function () {
            if($('#open_close_4').attr('class')=='close_left_search'){
                $('#left_search').animate({
                    'width':'224px'
                }, function(){
                    $('#left_search').removeClass('overfl');
                    sravn_table_div();
                });
                $('#td_224').animate({
                    'width':'224px'
                });
                $('#open_close_4').removeClass('close_left_search');	
            }
            else {
                $('#left_search').addClass('overfl').animate({
                    'width':'0'
                }, function(){
                    sravn_table_div();
                });
                $('#td_224').animate({
                    'width':'0'
                });
                $('#open_close_4').addClass('close_left_search');
            }
        });

        $('.sravnenie_table td div, .sravnenie_table_titles div:not(.sravnenie_table_titles div.title)').hover(function(){
            var cl=$(this).attr('class').replace('galka','');
            $('.sravnenie_table td').find('.'+cl).addClass('hover');	
            $(".sravnenie_table_titles").find('div.'+cl).addClass('hover');	
        }, function(){
            $('.sravnenie_table td div').removeClass('hover');	
            $('.sravnenie_table_titles  div').removeClass('hover');	
        })

        var delay = (function(){
            var timer = 0;
            return function(callback, ms){
                clearTimeout (timer);
                timer = setTimeout(callback, ms);
            };
        })();

        $(window).resize(function() {
            delay(function(){
                sravn_table_div()
            }, 200);
        });
    }*/
    /*Сравнение товаров-->*/
    
    
    //    clearCompareTable();
        
    
    /* $('#differences').live('click',function(){
       $.ajax({
            url: '/js/_ajax/compare.php',
            data: {act:'compare',param:'dif'},
            type: 'post',
             beforeSend: function(){                    
                    //Тело функции
            },
            success: function(response){
                    $('#content').html(response);
                    clearCompareTable();
            }            
        }); 
        return false;
    });
    
    $('#compare').live('click',function(){
       $.ajax({
            url: '/js/_ajax/compare.php',
            data: {act:'compare',param:'compare'},
            type: 'post',
             beforeSend: function(){                    
                    //Тело функции
            },
            success: function(response){
                    $('#content').html(response);
                    clearCompareTable();
            }            
        }); 
        return false;
    });*/
	
	//Работа с кнопкой обратной связи в футере
	var foot_feedback = $('#foot_feedback');
	if(foot_feedback.length) {
		foot_feedback.click(function(){			
			popup('#feedback');
			return false;
		});
	}

    // Создание элементов (окно сообщений, подсказки)
    create_boxes();
    $(window).keydown(function(event){
        _key(event);
    });
    load_need_data();
    $('a[rel=external]').click(function(){
        this.target = "_blank";
    });


});

function add_product_id() {
	var product_id = $('#product_id_for_feedback');
	if(product_id.length) {
		$('#fields360').val(product_id.val());
	}
	
}


function sh_next(id,e){
    $(id).slideToggle('slow', function(){
        $(e).html(($(this).css('height')=='auto'?'смотреть все':'скрыть все'));
    });
}

function call_add_car(cur_SID, lite){

    if(lite) {
        var brend_id = $('#lite_car').val();
        var model_id = $('#lite_model').val();
        var mod_id = $('#lite_mod').val();
        var car_year = $('#lite_year').val();        
    }
    else {
        var brend_id = $('#brend').val();
        var model_id = $('#model').val();
        var mod_id = $('#mod').val();
        var car_year = $('#year').val();        
    }

    if(!brend_id || !model_id || !mod_id || !car_year) return false;

    add_users_car(cur_SID, brend_id, model_id, mod_id, car_year, lite);
}

function add_users_car(cur_SID, brend_id, model_id, mod_id, year, lite)
{
    if(!cur_SID || !brend_id || !model_id || !mod_id || !year) return false;	

    if(lite){

        $.ajax({
            url: '/js/_ajax/car.php',
            data: {
                cur_SID:cur_SID, 
                car_year:year, 
                brend_id:brend_id, 
                model_id:model_id, 
                mod_id:mod_id, 
                action:'add',
                template:'lite'
            },
            type: 'post',
            beforeSend:function(){
                $('#lite_ajax').html('<img src="/_templates/default/cimages/loading/big-ajax-loader.gif">');	
            },
            success:function(data){                
                $('#lite_ajax').html(data);	
            }
        });

    }	
    else {
        $.ajax({
            url: '/js/_ajax/car.php',
            data:{
                cur_SID:cur_SID, 
                car_year:year, 
                brend_id:brend_id, 
                model_id:model_id, 
                mod_id:mod_id, 
                action:'add'
            },
            type: 'post',
            beforeSend:function(){
                $('#cars_list').html('<img src="/_templates/default/cimages/loading/big-ajax-loader.gif">');	
            },
            success:function(data){                
                $('#cars_list').html(data);	
            }
        });	
    }
}

function ask_remove_users_car(car_id, cur_SID, lite){
    if (lite) {
        remove_func = new Function("remove_users_car('"+car_id+"', '"+cur_SID+"', '"+lite+"');");
    }
    else {
        remove_func = new Function("remove_users_car('"+car_id+"', '"+cur_SID+"');");
    }
    mes.show('confirm','Вы действительно хотите удалить автомобиль?');
}

function remove_users_car(car_id, cur_SID, lite)
{
    if(!car_id || !cur_SID) return false;	

    if(lite){
        $.ajax({
            url: '/js/_ajax/car.php',
            data: {
                cur_SID:cur_SID, 
                car_id:car_id, 
                action:'remove', 
                template:'lite'
            },
            type: 'post',
            beforeSend:function(){
                $('#lite_ajax').html('<img src="/_templates/default/cimages/loading/big-ajax-loader.gif">');	
            },
            success:function(data){                
                $('#lite_ajax').html(data);	
            }
        });
    }

    else {
	
        $.ajax({
            url: '/js/_ajax/car.php',
            data: {
                cur_SID:cur_SID, 
                car_id:car_id, 
                action:'remove'
            },
            type: 'post',
            beforeSend:function(){
                $('#cars_list').html('<img src="/_templates/default/cimages/loading/big-ajax-loader.gif">');	
            },
            success:function(data){                
                $('#cars_list').html(data);	
            }
        });	
    }
	
}

function change_active_user_car(car_id, cur_SID, lite)
{		
    addCookie ('current_car', car_id, 30);	
	
    if(lite){
        $.ajax({
            url: '/js/_ajax/car.php',
            data: {
                cur_SID:cur_SID, 
                car_id:car_id, 
                action:'active', 
                template:'lite'
            },
            type: 'post',
            beforeSend:function(){
                $('#lite_ajax').html('<img src="/_templates/default/cimages/loading/big-ajax-loader.gif">');	
            },
            success:function(data){                
                $('#lite_ajax').html(data);
                k_reload_catalog();	
            }
        });	
    }
    else{

        $.ajax({
            url: '/js/_ajax/car.php',
            data: {
                cur_SID:cur_SID, 
                car_id:car_id, 
                action:'active'
            },
            type: 'post',
            beforeSend:function(){
                $('#cars_list').html('<img src="/_templates/default/cimages/loading/big-ajax-loader.gif">');	
            },
            success:function(data){                
                $('#cars_list').html(data);	
            }
        });
    }
}

function ajax_reload_catalog() {
    
    var level = $('#aj_level').val();
    var currentUser = $('#aj_currentUser').val();
    var categoryId = $('#aj_categoryId').val();
    var page = $('#aj_page').val();
    var url = $('#aj_url').val();
    //if(!$('#ajax_catalog').length || !level || !categoryId || !page || !url) return false;
    
    
    $.ajax({
        url: '/js/_ajax/ajax_catalog.php',
        data: {
            'level':level, 
            'currentUser':currentUser, 
            'categoryId':categoryId, 
            'page':page, 
            'url':url
        },
        type: 'post',
        beforeSend:function(){
            var system_fields = $('#ajax_system_fields').html();
            if(!system_fields) system_fields = '';
            $('#ajax_catalog').html('<div style="padding-left:50px; padding-top:50px;">'+'<img src="/_templates/default/cimages/loading/big-ajax-loader.gif">'+system_fields+'</div>');
        },
        success:function(data){
            $('#ajax_catalog').replaceWith(data);
            $('#ajax_catalog tr').eq(0).find('td').css({
                'border':'0px'
            });   
        }              
    });  
}

function k_reload_catalog() {

    var level = $('#aj_level').val();
    var currentUser = $('#aj_currentUser').val();
    var categoryId = $('#aj_categoryId').val();
    var page = $('#aj_page').val();
    var url = $('#aj_url').val();
    if(!$('#ajax_catalog').length || !level || !categoryId || !page || !url) return false;
    $.ajax({
        url: '/js/_ajax/ajax_catalog.php',
        data: {
            'level':level, 
            currentUser:currentUser, 
            categoryId:categoryId, 
            page:page, 
            url:url
        },
        type: 'post',
        beforeSend:function(){
            var system_fields = $('#ajax_system_fields').html();
            if(!system_fields) system_fields = '';
            $('#ajax_catalog').html('<div style="padding-left:50px; padding-top:50px;">'+'<img src="/_templates/default/cimages/loading/big-ajax-loader.gif">'+system_fields+'</div>');
        },
        success:function(data){              
            $('#ajax_catalog').replaceWith(data);
            $('#ajax_catalog tr').eq(0).find('td').css({
                'border':'0px'
            });
            /*Начало скриптов по селектам сортировки*/
            $("html").click( function () {
                $('.openC2 .openC').css({
                    'display':'none'
                })	;
                $('.openC2 .openC').removeClass('openC');										  
            });
            $(".navig_select").hover( function () {
                $(this).removeClass('openC2');
            }, function() {
                $(this).addClass('openC2');
            });
            $('.navig_select .face').click( function () {									
                if ($(this.parentNode).find('.navig_list_bg').attr('class')=='navig_list_bg openC'){
                    $(this.parentNode).find('.navig_list_bg').css({
                        'display':'none'
                    })	;
                    $(this.parentNode).find('.navig_list_bg').removeClass('openC');
                }
                else {
                    $(this.parentNode).find('.navig_list_bg').css({
                        'display':'block'
                    })	;
                    $(this.parentNode).find('.navig_list_bg').addClass('openC');	
                }
            });	
            $('.navig_select .navig_list_bg3 ul li a').click( function () {
                $(this).parents('.navig_select').find('.face span').html($(this).html())
                $(this).parents('.navig_select').find('.navig_list_bg').css({
                    'display':'none'
                })	;
                $(this).parents('.navig_select').find('.navig_list_bg').removeClass('openC');	
            });	
        /*Конец скриптов по селектам сортировки*/
        }
    });
}


//<-- B Kladov
// аналог parentNode 
function parentTag(node) { 
    return node.parentNode; 
} 
// аналог previousSibling 
function previousTag(node) { 
    var node = node.previousSibling; 
    return (node && node.nodeType!=1) ? previousTag(node) : node; 
} 
// аналог nextSibling 
function nextTag(node) { 
    var node = node.nextSibling; 
    return (node && node.nodeType!=1) ? nextTag(node) : node; 
} 
// аналог firstChild 
function firstChildTag(node) { 
    var node = node.firstChild; 
    return (node && node.nodeType!=1) ? nextTag(node) : node; 
} 
// аналог lastChild 
function lastChildTag(node) { 
    var node = node.lastChild; 
    return (node && node.nodeType!=1) ? previousTag(node) : node; 
} 
//--> B Kladov








//Скрипты для лайт машинок

$(document).ready(function(){       
    $('#lite_year , #lite_car').change(function(){
        var year = $('#lite_year');
        var car = $('#lite_car');
        var model = $('#div_lite_model');
        var mod = $('#div_lite_mod');

        //Обнуляем модель и модификацию
        model.find('.text').html('Модель');
        model.find('#lite_model').val('');
        mod.find('.text').html('Модификация');
        mod.find('#lite_mod').val('');

        //Блокируем модификацию
        mod.removeAttr('class').addClass('select_div noactive changer');
        model.removeAttr('class').addClass('select_div noactive changer');

        //Проверяем выбраны ли год и марка
        //если да то разрешаем выбор модели
        if(!year.val() || !car.val())
        {
        //
        }
        else
        {
            $.ajax({
                url:'/js/_ajax/ajax-brends.php',
                data: {
                    year:year.val(), 
                    type:car.val()
                },
                type: 'post',
                beforeSend: function(){ 
                    model.find('div.text').after('<span class="loader" style="height:5px;"><img src="/_templates/default/cimages/loading/ajax-loader_1.gif"></span>');
                    $('#lite_mod').change();
                },
                success: function(data){
					
                    var current_models = $('#models_ul');
                    current_models.html('');
					
                    carModels = data.split(':');
                    $.each(carModels, function(key, value) { 
                        //myArr [1]->id  [0]->name                    
                        var myArr = value.split(',');
                        current_models.append("<li><a onclick=\"$('#lite_model').val('"+myArr[1]+"'); $('#div_lite_model').find('.text').html('"+myArr[0]+"'); $('#lite_model').change();\">"+myArr[0]+"</a></li>");
                    });					
                    model.find('span.loader').remove();
                    model.removeAttr('class').addClass('select_div');
						

                    var model_scroll_pane = $("#model_scroll_pane");

                    model_scroll_pane.jScrollPaneRemove();																						
                    $('.uldiv').css({
                        'display':'block',
                        'visibility':'hidden'
                    });
                    if(model_scroll_pane.height()>360) {
                        model_scroll_pane.height('360px');
                    }
                    else {
                        model_scroll_pane.css('height','auto');
                    }
                    model_scroll_pane.jScrollPane({
                        showArrows:true, 
                        scrollbarWidth: 15
                    });

                    $('.uldiv').css({
                        'display':'none',
                        'visibility':'visible'
                    });	
																												
                }				
            });

        }
		
    });

    $('#lite_model').change(function(){
        var model = $('#lite_model');
        var mod = $('#div_lite_mod');
		
        //обнуляем модификацию
        mod.find('.text').html('Модификация');
        mod.find('#lite_mod').val('');				

        if(!model.val())
        {
            mod.removeAttr('class').addClass('select_div noactive changer');
        }
        else
        {
            mod.removeAttr('class').addClass('select_div');
            //			$('#div_lite_model').removeAttr('class').addClass('select_div');
            $('#div_lite_model').find('.uldiv').removeAttr('class').addClass('uldiv open');

            $.ajax({
                url:'/js/_ajax/ajax-brends.php',
                data: {
                    'model':model.val()
                },
                type: 'post',
                beforeSend: function(){ 
                    mod.find('div.text').after('<span class="loader" style="height:5px;"><img src="/_templates/default/cimages/loading/ajax-loader_1.gif"></span>');	
                    $('#lite_mod').change();
                },
                success: function(data){

                    var current_mods = $('#mods_ul');
                    current_mods.html('');

                    carMods = data.split(':');
                    $.each(carMods, function(key, value) { 
                        //myArr [1]->id  [0]->name                    
                        var myArr = value.split(',');
                        current_mods.append("<li><a onclick=\"$('#lite_mod').val('"+myArr[1]+"'); $('#div_lite_mod').find('.text').html('"+myArr[0]+"'); $('#lite_mod').change();\">"+myArr[0]+"</a></li>");
                    });	

                    mod.find('span.loader').remove();




                    var mod_scroll_pane = $("#mod_scroll_pane");

                    mod_scroll_pane.jScrollPaneRemove();																						
                    $('.uldiv').css({
                        'display':'block',
                        'visibility':'hidden'
                    });
                    if(mod_scroll_pane.height()>360) {
                        mod_scroll_pane.height('360px');
                    }
                    else {
                        mod_scroll_pane.css('height','auto');
                    }
                    mod_scroll_pane.jScrollPane({
                        showArrows:true, 
                        scrollbarWidth: 15
                    });

                    $('.uldiv').css({
                        'display':'none',
                        'visibility':'visible'
                    });							
                }
            });



        }

    });

    $('#lite_mod').change(function(){
        $('#div_lite_mod').find('.uldiv').removeAttr('class').addClass('uldiv open');
        modId = $('#lite_mod').val();
        if(modId) {
            $('#add_car_filter').removeAttr('class').addClass('my_button');
        }
        else {
            $('#add_car_filter').removeAttr('class').addClass('my_button disable');
        }
    });
});

function clearCompareTable() {
    $('#compare_table tr').each(function(){
                        
        var temp = $(this).find('.feature');
            
        var id = $(this).attr('id'); 
            
        if(!id.match(/^[0-9]*_0$/)) {                                                           
            var display = false;
                                
            temp.each(function(){                    
                if($(this).text())
                    display = true
            });
                
            if(!display && id) $('#'+id).hide();  
        }            
                 
    });

    var last = '';
    var current = '';
        
    $('#compare_table tr').each(function(){
        last = current;
        current = $(this).attr('id');
        if(current === last) {
            if(last)
                $('#'+last).hide();
        }
    });
        
}

/*<--Сравнение товаров*/
function sravn_table_div(){
    $(".sravnenie_table_titles div:not(.sravnenie_table_titles div.title)").each(function(i) {
        var tc=this;										   
        var th=	$(this).attr('class');
        var dh= $(this).height();
        $('.sravnenie_table td').find('.'+th).each(function(i) {
            if ($(this).height()>dh){
                dh=$(this).height();
            }
        })	
        $('.sravnenie_table td').find('.'+th).css({
            'height':dh
        });
        $(".sravnenie_table_titles").find('div.'+th).css({
            'height':dh
        });
    })
    if($.browser.mozilla){
        var top=$(".sravnenie_table tr").eq(1).offset().top-$("#header").height()-33;
    }
    else {
        var top=$(".sravnenie_table tr").eq(1).offset().top-$("#header").height()-32;
    }
    $('.sravnenie_table_titles').css({
        'top':top
    })
    var tableW=$('.sravnenie_table td.tovar_foto_price').length*244;
    $('.sravnenie_table_block').css({
        'width':tableW
    });
    $('.sravnenie_table_block_scroll').hide();
    var ww=$('.sravnenie_table_block_scroll').parent().width();
    $('.sravnenie_table_block_scroll').css({
        'width':ww
    }).show();
}
/*Сравнение товаров-->*/
