/*
 * Rokmoomenu - mootools menu widget
 *
 * mootools dependencies:
 *	- mootools 1.11
 *	- Moo, Utility, Common, Array, String, Function, Element, 
 *	  Dom, Fx.Base, Fx.CSS, Fx.Styles
 *
 * Copyright (c) 2007 Olmo Maldonado
 *
 * v1.2 - Adapted for IE6 by Djamil Legato (c) 2008
 * 
 * History
 * v1.1 - Flash Issues - Adapted for IE6 by Djamil Legato
 */
//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}('5 C=R G({6:{m:1t,7:\'1c\',j:12,l:{h:[\'z\',\'Q\'],F:G.1i}},1f:3(b,c){2.11(c);4(n.q)2.6.j=X;2.w=$(b);2.w.V(\'T\').9(3(a){a.1o({\'1l\':2.M.H(2,a),\'1e\':2.I.H(2,a)})},2)},M:3(b){$1b(b.L);4(!b.8(2.6.7)){4(n.q){5 c=b.P(\'E\').O(" ");5 d=2.6.7;c=c.D(3(y){k!y.p("-"+d)});c.9(3(a){4(b.8(a))b.o(a+"-"+d)},2);5 e=c.B("-")+"-"+d;4(!b.8(e))b.o(e)}b.o(2.6.7);5 f=b.A(\'x\');4(f){4(2.6.m)f.m({z:W});f.l(2.6.l)}b.v().9(3(a){a.g(2.6.7)},2)}},I:3(e){5 f=2.6.7;e.L=(3(){4(n.q){5 b=e.P(\'E\').O(" ");b=b.D(3(y){k y.p("-"+f)});b.9(3(a){4(e.8(a))e.g(a)},2);5 c=b.B("-")+"-"+f;4(!e.8(c))e.g(c)}e.g(f);5 d=e.A(\'U\');4(d)d.Y()}).j(2.6.j,2)}});C.Z(R 10);1s.1q({l:3(b){4(!2.u){2.u=2.1p(b.F);2.s=2.1m.1k(2,b.h);2.t={};1h(5 i 1g 2.s)2.t[i]=0}4(b.h.S(\'Q\')||b.h.S(\'1d\')){2.K(\'J\',\'1a\');2.N(\'x\').9(3(a){a.K(\'J\',\'19\')})}2.u.1j(2.t).18(2.s)},N:3(a){5 b=[];5 c=2.r();17(c&&c!==1n){4(c.16().p(a))b.15(c);c=c.r()}k b},v:3(){5 a=2.r().14();a.1r(a.13(2),1);k a}});',62,92,'||this|function|if|var|options|hoverClass|hasClass|each|||||||removeClass|props||delay|return|animate|bgiframe|window|addClass|test|ie6|getParent|now|FxEmpty|Fx|getSiblings|element|ul||opacity|getElement|join|Rokmoomenu|filter|class|opts|Class|bind|out|overflow|setStyle|sfTimer|over|getParents|split|getProperty|height|new|contains|li|iframe|getElements|false|50|remove|implement|Options|setOptions|500|indexOf|getChildren|push|getTag|while|start|visible|hidden|clear|sfHover|width|mouseout|initialize|in|for|empty|set|apply|mouseover|getStyles|document|addEvents|effects|extend|splice|Element|true'.split('|'),0,{}))

var Rokmoomenu = new Class({
    options: {
        bgiframe: true,
        hoverClass: 'sfHover',
        delay: 500,
        animate: {
            props: ['opacity', 'height'],
            opts: Class.empty
        }
    },
    initialize: function (b, c) {
        this.setOptions(c);
        if (window.ie6) this.options.delay = 50;
        this.element = $(b);
        this.element.getElements('li').each(function (a) {
            a.addEvents({
                'mouseover': this.over.bind(this, a),
                'mouseout': this.out.bind(this, a)
            })
        }, this)
    },
    over: function (b) {
        $clear(b.sfTimer);
        if (!b.hasClass(this.options.hoverClass)) {
            if (window.ie6) {
                var c = b.getProperty('class').split(" ");
                var d = this.options.hoverClass;
                c = c.filter(function (y) {
                    return !y.test("-" + d)
                });
                c.each(function (a) {
                    if (b.hasClass(a)) b.addClass(a + "-" + d)
                }, this);
                var e = c.join("-") + "-" + d;
                if (!b.hasClass(e)) b.addClass(e)
            }
            b.addClass(this.options.hoverClass);
            var f = b.getElement('ul');
            if (f) {
                if (this.options.bgiframe) f.bgiframe({
                    opacity: false
                });
                f.animate(this.options.animate)
            }
            b.getSiblings().each(function (a) {
                a.removeClass(this.options.hoverClass)
            }, this)
        }
    },
    out: function (e) {
        var f = this.options.hoverClass;
        e.sfTimer = (function () {
            if (window.ie6) {
                var b = e.getProperty('class').split(" ");
                b = b.filter(function (y) {
                    return y.test("-" + f)
                });
                b.each(function (a) {
                    if (e.hasClass(a)) e.removeClass(a)
                }, this);
                var c = b.join("-") + "-" + f;
                if (!e.hasClass(c)) e.removeClass(c)
            }
            e.removeClass(f);
            var d = e.getElement('iframe');
            if (d) d.remove()
        }).delay(this.options.delay, this)
    }
});
Rokmoomenu.implement(new Options);
Element.extend({
    animate: function (b) {
        if (!this.Fx) {
            this.Fx = this.effects(b.opts);
            this.now = this.getStyles.apply(this, b.props);
            this.FxEmpty = {};
            for (var i in this.now) this.FxEmpty[i] = 0
        }
        if (b.props.contains('height') || b.props.contains('width')) {
            this.setStyle('overflow', 'hidden');
            this.getParents('ul').each(function (a) {
                a.setStyle('overflow', 'visible')
            })
        }
        this.Fx.set(this.FxEmpty).start(this.now)
    },
    getParents: function (a) {
        var b = [];
        var c = this.getParent();
        while (c && c !== document) {
            if (c.getTag().test(a)) b.push(c);
            c = c.getParent()
        }
        return b
    },
    getSiblings: function () {
        var a = this.getParent().getChildren();
        a.splice(a.indexOf(this), 1);
        return a
    }
});
