/* Simple Accordion Script 
 * Requires Prototype and Script.aculo.us Libraries
 * By: Brian Crescimanno <brian.crescimanno@gmail.com>
 * http://briancrescimanno.com
 * This work is licensed under the Creative Commons Attribution-Share Alike 3.0
 * http://creativecommons.org/licenses/by-sa/3.0/us/
 */
 
/* Úprava pro potřeby změny designu po kliknutí na určitý accordion
 * Tomáš Nedvěd, http://programator.ne2d.cz
 * 2009
 */ 

if (typeof Effect == 'undefined')
  throw("You must have the script.aculo.us library to use this accordion");

var Accordion = Class.create({

    initialize: function(id, defaultExpandedCount) {
        if(!$(id)) throw("Attempted to initalize accordion with id: "+ id + " which was not found.");
        this.accordion = $(id);
        this.options = {
            toggleClass: "accordion-toggle",
            toggleActive: "accordion-toggle-active",
            contentClass: "accordion-content"
        }
        this.contents = this.accordion.select('div.'+this.options.contentClass);
        this.isAnimating = false;
        this.maxHeight = 0;
        this.current = defaultExpandedCount ? this.contents[defaultExpandedCount-1] : this.contents[0];
        this.toExpand = null;

        this.checkMaxHeight();
        this.initialHide();
        this.attachInitialMaxHeight();

        var clickHandler =  this.clickHandler.bindAsEventListener(this);
        this.accordion.observe('click', clickHandler);        
    },

    expand: function(el) {
        this.toExpand = el.next('div.'+this.options.contentClass);
        if(this.current != this.toExpand){
			  this.toExpand.show();
            this.animate();
            ///////////
            // -> TN //
            for(var i=0; i<this.contents.length; i++){
                if(this.contents[i] == this.toExpand) {
                    switch(i) {
                        case 0: 
                            document.getElementById("wrapper").style.background = '#ffffff url(css/img/pozadi_01.jpg) no-repeat';
                            
                            /////////////////////////////////////////////////////////////
                            //document.getElementById("acctog0").style.color = '#666666';
                            document.getElementById("acctog1").style.color = '#666666';
                            document.getElementById("acctog2").style.color = '#666666';
                            document.getElementById("acctog3").style.color = '#666666';
                            document.getElementById("acctog4").style.color = '#666666';
                            document.getElementById("acctog5").style.color = '#666666';
                            document.getElementById("acctog6").style.color = '#666666';
                            document.getElementById("acctog7").style.color = '#666666';
                            document.getElementById("acctog8").style.color = '#666666';
                            //document.getElementById("acctog0").style.background = '#e3e4e6';
                            document.getElementById("acctog1").style.background = '#e3e4e6';
                            document.getElementById("acctog2").style.background = '#e3e4e6';
                            document.getElementById("acctog3").style.background = '#e3e4e6';
                            document.getElementById("acctog4").style.background = '#e3e4e6';
                            document.getElementById("acctog5").style.background = '#e3e4e6';
                            document.getElementById("acctog6").style.background = '#e3e4e6';
                            document.getElementById("acctog7").style.background = '#e3e4e6';
                            document.getElementById("acctog8").style.background = '#e3e4e6';
                            /**/document.getElementById("acctog0").onmouseover = function() { this.style.backgroundColor = "#c1c3c8"; this.style.color = "#e1017b"; }
                            /**/document.getElementById("acctog0").onmouseout = function() { this.style.backgroundColor = "#c1c3c8"; this.style.color = "#e1017b"; }
                            document.getElementById("acctog1").onmouseover = function() { this.style.backgroundColor = "#c1c3c8"; this.style.color = "#e1017b"; }
                            document.getElementById("acctog1").onmouseout = function() { this.style.backgroundColor = "#e3e4e6"; this.style.color = "#666666"; }
                            document.getElementById("acctog2").onmouseover = function() { this.style.backgroundColor = "#c1c3c8"; this.style.color = "#e1017b"; }
                            document.getElementById("acctog2").onmouseout = function() { this.style.backgroundColor = "#e3e4e6"; this.style.color = "#666666"; }
                            document.getElementById("acctog3").onmouseover = function() { this.style.backgroundColor = "#c1c3c8"; this.style.color = "#e1017b"; }
                            document.getElementById("acctog3").onmouseout = function() { this.style.backgroundColor = "#e3e4e6"; this.style.color = "#666666"; }
                            document.getElementById("acctog4").onmouseover = function() { this.style.backgroundColor = "#c1c3c8"; this.style.color = "#e1017b"; }
                            document.getElementById("acctog4").onmouseout = function() { this.style.backgroundColor = "#e3e4e6"; this.style.color = "#666666"; }
                            document.getElementById("acctog5").onmouseover = function() { this.style.backgroundColor = "#c1c3c8"; this.style.color = "#e1017b"; }
                            document.getElementById("acctog5").onmouseout = function() { this.style.backgroundColor = "#e3e4e6"; this.style.color = "#666666"; }
                            document.getElementById("acctog6").onmouseover = function() { this.style.backgroundColor = "#c1c3c8"; this.style.color = "#e1017b"; }
                            document.getElementById("acctog6").onmouseout = function() { this.style.backgroundColor = "#e3e4e6"; this.style.color = "#666666"; }
                            document.getElementById("acctog7").onmouseover = function() { this.style.backgroundColor = "#c1c3c8"; this.style.color = "#e1017b"; }
                            document.getElementById("acctog7").onmouseout = function() { this.style.backgroundColor = "#e3e4e6"; this.style.color = "#666666"; }
                            document.getElementById("acctog8").onmouseover = function() { this.style.backgroundColor = "#c1c3c8"; this.style.color = "#e1017b"; }
                            document.getElementById("acctog8").onmouseout = function() { this.style.backgroundColor = "#e3e4e6"; this.style.color = "#666666"; }
                            
                            break;
                        case 1:
                            document.getElementById("wrapper").style.background = '#ffffff url(css/img/pozadi_01.jpg) no-repeat';
                 
                            document.getElementById("acctog1").style.color = '#e1017b';
                            document.getElementById("acctog1").style.background = '#000000';
                            
                            document.getElementById("acccon1").style.background = '#000000 url(css/img/zobacek5.gif) no-repeat';
                            
                            /////////////////////////////////////////////////////////////
                            document.getElementById("acctog0").style.color = '#666666';
                            //document.getElementById("acctog1").style.color = '#666666';
                            document.getElementById("acctog2").style.color = '#666666';
                            document.getElementById("acctog3").style.color = '#666666';
                            document.getElementById("acctog4").style.color = '#666666';
                            document.getElementById("acctog5").style.color = '#666666';
                            document.getElementById("acctog6").style.color = '#666666';
                            document.getElementById("acctog7").style.color = '#666666';
                            document.getElementById("acctog8").style.color = '#666666';
                            document.getElementById("acctog0").style.background = '#e3e4e6';
                            //document.getElementById("acctog1").style.background = '#e3e4e6';
                            document.getElementById("acctog2").style.background = '#e3e4e6';
                            document.getElementById("acctog3").style.background = '#e3e4e6';
                            document.getElementById("acctog4").style.background = '#e3e4e6';
                            document.getElementById("acctog5").style.background = '#e3e4e6';
                            document.getElementById("acctog6").style.background = '#e3e4e6';
                            document.getElementById("acctog7").style.background = '#e3e4e6';
                            document.getElementById("acctog8").style.background = '#e3e4e6';
                            document.getElementById("acctog0").onmouseover = function() { this.style.backgroundColor = "#c1c3c8"; this.style.color = "#e1017b"; }
                            document.getElementById("acctog0").onmouseout = function() { this.style.backgroundColor = "#e3e4e6"; this.style.color = "#666666"; }
                            /**/document.getElementById("acctog1").onmouseover = function() { this.style.backgroundColor = "#c1c3c8"; this.style.color = "#e1017b"; }
                            /**/document.getElementById("acctog1").onmouseout = function() { this.style.backgroundColor = "#c1c3c8"; this.style.color = "#e1017b"; }
                            document.getElementById("acctog2").onmouseover = function() { this.style.backgroundColor = "#c1c3c8"; this.style.color = "#e1017b"; }
                            document.getElementById("acctog2").onmouseout = function() { this.style.backgroundColor = "#e3e4e6"; this.style.color = "#666666"; }
                            document.getElementById("acctog3").onmouseover = function() { this.style.backgroundColor = "#c1c3c8"; this.style.color = "#e1017b"; }
                            document.getElementById("acctog3").onmouseout = function() { this.style.backgroundColor = "#e3e4e6"; this.style.color = "#666666"; }
                            document.getElementById("acctog4").onmouseover = function() { this.style.backgroundColor = "#c1c3c8"; this.style.color = "#e1017b"; }
                            document.getElementById("acctog4").onmouseout = function() { this.style.backgroundColor = "#e3e4e6"; this.style.color = "#666666"; }
                            document.getElementById("acctog5").onmouseover = function() { this.style.backgroundColor = "#c1c3c8"; this.style.color = "#e1017b"; }
                            document.getElementById("acctog5").onmouseout = function() { this.style.backgroundColor = "#e3e4e6"; this.style.color = "#666666"; }
                            document.getElementById("acctog6").onmouseover = function() { this.style.backgroundColor = "#c1c3c8"; this.style.color = "#e1017b"; }
                            document.getElementById("acctog6").onmouseout = function() { this.style.backgroundColor = "#e3e4e6"; this.style.color = "#666666"; }
                            document.getElementById("acctog7").onmouseover = function() { this.style.backgroundColor = "#c1c3c8"; this.style.color = "#e1017b"; }
                            document.getElementById("acctog7").onmouseout = function() { this.style.backgroundColor = "#e3e4e6"; this.style.color = "#666666"; }
                            document.getElementById("acctog8").onmouseover = function() { this.style.backgroundColor = "#c1c3c8"; this.style.color = "#e1017b"; }
                            document.getElementById("acctog8").onmouseout = function() { this.style.backgroundColor = "#e3e4e6"; this.style.color = "#666666"; }

                            break;    
                        case 2:
                            document.getElementById("wrapper").style.background = '#ffffff url(css/img/pozadi_01.jpg) no-repeat';

                            document.getElementById("acctog2").style.color = '#e1017b';
                            document.getElementById("acctog2").style.background = '#000000';
                            document.getElementById("acccon2").style.background = '#000000 url(css/img/zobacek5.gif) no-repeat';

                            /////////////////////////////////////////////////////////////
                            document.getElementById("acctog0").style.color = '#666666';
                            document.getElementById("acctog1").style.color = '#666666';
                            //document.getElementById("acctog2").style.color = '#666666';
                            document.getElementById("acctog3").style.color = '#666666';
                            document.getElementById("acctog4").style.color = '#666666';
                            document.getElementById("acctog5").style.color = '#666666';
                            document.getElementById("acctog6").style.color = '#666666';
                            document.getElementById("acctog7").style.color = '#666666';
                            document.getElementById("acctog8").style.color = '#666666';
                            document.getElementById("acctog0").style.background = '#e3e4e6';
                            document.getElementById("acctog1").style.background = '#e3e4e6';
                            //document.getElementById("acctog2").style.background = '#e3e4e6';
                            document.getElementById("acctog3").style.background = '#e3e4e6';
                            document.getElementById("acctog4").style.background = '#e3e4e6';
                            document.getElementById("acctog5").style.background = '#e3e4e6';
                            document.getElementById("acctog6").style.background = '#e3e4e6';
                            document.getElementById("acctog7").style.background = '#e3e4e6';
                            document.getElementById("acctog8").style.background = '#e3e4e6';
                            document.getElementById("acctog0").onmouseover = function() { this.style.backgroundColor = "#c1c3c8"; this.style.color = "#e1017b"; }
                            document.getElementById("acctog0").onmouseout = function() { this.style.backgroundColor = "#e3e4e6"; this.style.color = "#666666"; }
                            document.getElementById("acctog1").onmouseover = function() { this.style.backgroundColor = "#c1c3c8"; this.style.color = "#e1017b"; }
                            document.getElementById("acctog1").onmouseout = function() { this.style.backgroundColor = "#e3e4e6"; this.style.color = "#666666"; }
                            /**/document.getElementById("acctog2").onmouseover = function() { this.style.backgroundColor = "#c1c3c8"; this.style.color = "#e1017b"; }
                            /**/document.getElementById("acctog2").onmouseout = function() { this.style.backgroundColor = "#c1c3c8"; this.style.color = "#e1017b"; }
                            document.getElementById("acctog3").onmouseover = function() { this.style.backgroundColor = "#c1c3c8"; this.style.color = "#e1017b"; }
                            document.getElementById("acctog3").onmouseout = function() { this.style.backgroundColor = "#e3e4e6"; this.style.color = "#666666"; }
                            document.getElementById("acctog4").onmouseover = function() { this.style.backgroundColor = "#c1c3c8"; this.style.color = "#e1017b"; }
                            document.getElementById("acctog4").onmouseout = function() { this.style.backgroundColor = "#e3e4e6"; this.style.color = "#666666"; }
                            document.getElementById("acctog5").onmouseover = function() { this.style.backgroundColor = "#c1c3c8"; this.style.color = "#e1017b"; }
                            document.getElementById("acctog5").onmouseout = function() { this.style.backgroundColor = "#e3e4e6"; this.style.color = "#666666"; }
                            document.getElementById("acctog6").onmouseover = function() { this.style.backgroundColor = "#c1c3c8"; this.style.color = "#e1017b"; }
                            document.getElementById("acctog6").onmouseout = function() { this.style.backgroundColor = "#e3e4e6"; this.style.color = "#666666"; }
                            document.getElementById("acctog7").onmouseover = function() { this.style.backgroundColor = "#c1c3c8"; this.style.color = "#e1017b"; }
                            document.getElementById("acctog7").onmouseout = function() { this.style.backgroundColor = "#e3e4e6"; this.style.color = "#666666"; }
                            document.getElementById("acctog8").onmouseover = function() { this.style.backgroundColor = "#c1c3c8"; this.style.color = "#e1017b"; }
                            document.getElementById("acctog8").onmouseout = function() { this.style.backgroundColor = "#e3e4e6"; this.style.color = "#666666"; }
/*                            
                            document.getElementById("test-accordion").style.opacity = '1.00';
                            document.getElementById("test-accordion").style.filter = 'alpha(opacity=100)';
                            document.getElementById("test-accordion").style.MozOpacity = '1.0';
                            document.getElementById("test-accordion").style.KhtmlOpacity = '1.0';
                            
                            //document.getElementById("acctog0").style.opacity = '1.00';
                            //document.getElementById("acctog0").style.filter = 'alpha(opacity=100)';
                            //document.getElementById("acctog0").style.MozOpacity = '1.00';
                            //document.getElementById("acctog0").style.KhtmlOpacity = '1.00';

                            document.getElementById("acctog6").style.opacity = '1.00';
                            document.getElementById("acctog6").style.filter = 'alpha(opacity=100)';
                            document.getElementById("acctog6").style.MozOpacity = '1.00';
                            document.getElementById("acctog6").style.KhtmlOpacity = '1.00';
*/                            
                            break;    
                        case 3:
                            document.getElementById("wrapper").style.background = '#ffffff url(css/img/pozadi_03.jpg) no-repeat';
                            
                            document.getElementById("acctog0").style.color = '#ffffff';
                            document.getElementById("acctog1").style.color = '#ffffff';
                            document.getElementById("acctog2").style.color = '#ffffff';
                            document.getElementById("acctog3").style.color = '#e1017b';
                            document.getElementById("acctog4").style.color = '#000000';
                            document.getElementById("acctog5").style.color = '#000000';
                            document.getElementById("acctog6").style.color = '#000000';
                            document.getElementById("acctog7").style.color = '#000000';
                            document.getElementById("acctog8").style.color = '#000000';
                            
                            document.getElementById("acctog0").style.background = 'transparent';
                            document.getElementById("acctog1").style.background = 'transparent';
                            document.getElementById("acctog2").style.background = 'transparent';
                            document.getElementById("acctog3").style.background = 'transparent';
                            document.getElementById("acctog4").style.background = 'transparent';
                            document.getElementById("acctog5").style.background = 'transparent';
                            document.getElementById("acctog6").style.background = 'transparent';
                            document.getElementById("acctog7").style.background = 'transparent';
                            document.getElementById("acctog8").style.background = 'transparent';

                            document.getElementById("acctog0").style.borderTop = 'transparent';
                            document.getElementById("acctog1").style.borderTop = 'transparent';
                            document.getElementById("acctog2").style.borderTop = 'transparent';
                            document.getElementById("acctog3").style.borderTop = 'transparent';
                            document.getElementById("acctog4").style.borderTop = 'transparent';
                            document.getElementById("acctog5").style.borderTop = 'transparent';
                            document.getElementById("acctog6").style.borderTop = 'transparent';
                            document.getElementById("acctog7").style.borderTop = 'transparent';
                            document.getElementById("acctog8").style.borderTop = 'transparent';
                            
                            document.getElementById("acctog0").onmouseover = function() { /*this.style.backgroundColor = "transparent";*/ this.style.color = "#e1017b"; }
                            document.getElementById("acctog0").onmouseout = function() { this.style.backgroundColor = "transparent"; this.style.color = "#ffffff"; }
                            document.getElementById("acctog1").onmouseover = function() { /*this.style.backgroundColor = "transparent";*/ this.style.color = "#e1017b"; }
                            document.getElementById("acctog1").onmouseout = function() { this.style.backgroundColor = "transparent"; this.style.color = "#ffffff"; }
                            document.getElementById("acctog2").onmouseover = function() { /*this.style.backgroundColor = "transparent";*/ this.style.color = "#e1017b"; }
                            document.getElementById("acctog2").onmouseout = function() { this.style.backgroundColor = "transparent"; this.style.color = "#ffffff"; }
                            /**/document.getElementById("acctog3").onmouseover = function() { this.style.backgroundColor = "transparent"; this.style.color = "#e1017b"; }
                            /**/document.getElementById("acctog3").onmouseout = function() { this.style.backgroundColor = "transparent"; this.style.color = "#e1017b"; }
                            document.getElementById("acctog4").onmouseover = function() { /*this.style.backgroundColor = "transparent";*/ this.style.color = "#e1017b"; }
                            document.getElementById("acctog4").onmouseout = function() { this.style.backgroundColor = "transparent"; this.style.color = "#000000"; }
                            document.getElementById("acctog5").onmouseover = function() { /*this.style.backgroundColor = "transparent";*/ this.style.color = "#e1017b"; }
                            document.getElementById("acctog5").onmouseout = function() { this.style.backgroundColor = "transparent"; this.style.color = "#000000"; }
                            document.getElementById("acctog6").onmouseover = function() { /*this.style.backgroundColor = "transparent";*/ this.style.color = "#e1017b"; }
                            document.getElementById("acctog6").onmouseout = function() { this.style.backgroundColor = "transparent"; this.style.color = "#000000"; }
                            document.getElementById("acctog7").onmouseover = function() { /*this.style.backgroundColor = "transparent";*/ this.style.color = "#e1017b"; }
                            document.getElementById("acctog7").onmouseout = function() { this.style.backgroundColor = "transparent"; this.style.color = "#000000"; }
                            document.getElementById("acctog8").onmouseover = function() { /*this.style.backgroundColor = "transparent";*/ this.style.color = "#e1017b"; }
                            document.getElementById("acctog8").onmouseout = function() { this.style.backgroundColor = "transparent"; this.style.color = "#000000"; }

                            
                            //document.getElementById("acccon3").style.background = '#ffffff';
                            
                            document.getElementById("acccon3").style.opacity = '.71';
                            document.getElementById("acccon3").style.filter = 'alpha(opacity=71)';
                            document.getElementById("acccon3").style.MozOpacity = '0.71';
                            document.getElementById("acccon3").style.KhtmlOpacity = '0.71';
                            document.getElementById("acccon3").style.color = '#000000';
                            //document.getElementById("acccon3").style.background = '#ffffff url(css/img/zobacek5.gif) no-repeat';
                            
                            document.getElementById("acctog0").style.opacity = '1.00';
                            document.getElementById("acctog0").style.filter = 'alpha(opacity=100)';
                            document.getElementById("acctog0").style.MozOpacity = '1.00';
                            document.getElementById("acctog0").style.KhtmlOpacity = '1.00';                     

                            document.getElementById("acctog6").style.opacity = '1.00';
                            document.getElementById("acctog6").style.filter = 'alpha(opacity=100)';
                            document.getElementById("acctog6").style.MozOpacity = '1.00';
                            document.getElementById("acctog6").style.KhtmlOpacity = '1.00';                     


                            break;

                        case 4:
                            document.getElementById("wrapper").style.background = '#ffffff url(css/img/pozadi_01.jpg) no-repeat';

                            document.getElementById("acctog4").style.color = '#e1017b';
                            //document.getElementById("acctog4").style.background = '#000000';
                            //document.getElementById("acccon4").style.background = '#000000 url(css/img/zobacek5.gif) no-repeat';

                            /////////////////////////////////////////////////////////////
                            document.getElementById("acctog0").style.color = '#666666';
                            document.getElementById("acctog1").style.color = '#666666';
                            document.getElementById("acctog2").style.color = '#666666';
                            document.getElementById("acctog3").style.color = '#666666';
                            //document.getElementById("acctog4").style.color = '#666666';
                            document.getElementById("acctog5").style.color = '#666666';
                            document.getElementById("acctog6").style.color = '#666666';
                            document.getElementById("acctog7").style.color = '#666666';
                            document.getElementById("acctog8").style.color = '#666666';
                            document.getElementById("acctog0").style.background = '#e3e4e6';
                            document.getElementById("acctog1").style.background = '#e3e4e6';
                            document.getElementById("acctog2").style.background = '#e3e4e6';
                            document.getElementById("acctog3").style.background = '#e3e4e6';
                            //document.getElementById("acctog4").style.background = '#e3e4e6';
                            document.getElementById("acctog5").style.background = '#e3e4e6';
                            document.getElementById("acctog6").style.background = '#e3e4e6';
                            document.getElementById("acctog7").style.background = '#e3e4e6';
                            document.getElementById("acctog8").style.background = '#e3e4e6';
                            document.getElementById("acctog0").onmouseover = function() { this.style.backgroundColor = "#c1c3c8"; this.style.color = "#e1017b"; }
                            document.getElementById("acctog0").onmouseout = function() { this.style.backgroundColor = "#e3e4e6"; this.style.color = "#666666"; }
                            document.getElementById("acctog1").onmouseover = function() { this.style.backgroundColor = "#c1c3c8"; this.style.color = "#e1017b"; }
                            document.getElementById("acctog1").onmouseout = function() { this.style.backgroundColor = "#e3e4e6"; this.style.color = "#666666"; }
                            document.getElementById("acctog2").onmouseover = function() { this.style.backgroundColor = "#c1c3c8"; this.style.color = "#e1017b"; }
                            document.getElementById("acctog2").onmouseout = function() { this.style.backgroundColor = "#e3e4e6"; this.style.color = "#666666"; }
                            document.getElementById("acctog3").onmouseover = function() { this.style.backgroundColor = "#c1c3c8"; this.style.color = "#e1017b"; }
                            document.getElementById("acctog3").onmouseout = function() { this.style.backgroundColor = "#e3e4e6"; this.style.color = "#666666"; }
                            /**/document.getElementById("acctog4").onmouseover = function() { this.style.backgroundColor = "#c1c3c8"; this.style.color = "#e1017b"; }
                            /**/document.getElementById("acctog4").onmouseout = function() { this.style.backgroundColor = "#c1c3c8"; this.style.color = "#e1017b"; }
                            document.getElementById("acctog5").onmouseover = function() { this.style.backgroundColor = "#c1c3c8"; this.style.color = "#e1017b"; }
                            document.getElementById("acctog5").onmouseout = function() { this.style.backgroundColor = "#e3e4e6"; this.style.color = "#666666"; }
                            document.getElementById("acctog6").onmouseover = function() { this.style.backgroundColor = "#c1c3c8"; this.style.color = "#e1017b"; }
                            document.getElementById("acctog6").onmouseout = function() { this.style.backgroundColor = "#e3e4e6"; this.style.color = "#666666"; }
                            document.getElementById("acctog7").onmouseover = function() { this.style.backgroundColor = "#c1c3c8"; this.style.color = "#e1017b"; }
                            document.getElementById("acctog7").onmouseout = function() { this.style.backgroundColor = "#e3e4e6"; this.style.color = "#666666"; }
                            document.getElementById("acctog8").onmouseover = function() { this.style.backgroundColor = "#c1c3c8"; this.style.color = "#e1017b"; }
                            document.getElementById("acctog8").onmouseout = function() { this.style.backgroundColor = "#e3e4e6"; this.style.color = "#666666"; }
                            break;    

                        case 5:
                            document.getElementById("wrapper").style.background = '#ffffff url(css/img/pozadi_01.jpg) no-repeat';

                            document.getElementById("acctog5").style.color = '#e1017b';
                            document.getElementById("acctog5").style.background = '#000000';
                            
                            document.getElementById("acccon5").style.background = '#000000 url(css/img/zobacek5.gif) no-repeat';

                            /////////////////////////////////////////////////////////////
                            document.getElementById("acctog0").style.color = '#666666';
                            document.getElementById("acctog1").style.color = '#666666';
                            document.getElementById("acctog2").style.color = '#666666';
                            document.getElementById("acctog3").style.color = '#666666';
                            document.getElementById("acctog4").style.color = '#666666';
                            //document.getElementById("acctog5").style.color = '#666666';
                            document.getElementById("acctog6").style.color = '#666666';
                            document.getElementById("acctog7").style.color = '#666666';
                            document.getElementById("acctog8").style.color = '#666666';
                            document.getElementById("acctog0").style.background = '#e3e4e6';
                            document.getElementById("acctog1").style.background = '#e3e4e6';
                            document.getElementById("acctog2").style.background = '#e3e4e6';
                            document.getElementById("acctog3").style.background = '#e3e4e6';
                            document.getElementById("acctog4").style.background = '#e3e4e6';
                            //document.getElementById("acctog5").style.background = '#e3e4e6';
                            document.getElementById("acctog6").style.background = '#e3e4e6';
                            document.getElementById("acctog7").style.background = '#e3e4e6';
                            document.getElementById("acctog8").style.background = '#e3e4e6';
                            document.getElementById("acctog0").onmouseover = function() { this.style.backgroundColor = "#c1c3c8"; this.style.color = "#e1017b"; }
                            document.getElementById("acctog0").onmouseout = function() { this.style.backgroundColor = "#e3e4e6"; this.style.color = "#666666"; }
                            document.getElementById("acctog1").onmouseover = function() { this.style.backgroundColor = "#c1c3c8"; this.style.color = "#e1017b"; }
                            document.getElementById("acctog1").onmouseout = function() { this.style.backgroundColor = "#e3e4e6"; this.style.color = "#666666"; }
                            document.getElementById("acctog2").onmouseover = function() { this.style.backgroundColor = "#c1c3c8"; this.style.color = "#e1017b"; }
                            document.getElementById("acctog2").onmouseout = function() { this.style.backgroundColor = "#e3e4e6"; this.style.color = "#666666"; }
                            document.getElementById("acctog3").onmouseover = function() { this.style.backgroundColor = "#c1c3c8"; this.style.color = "#e1017b"; }
                            document.getElementById("acctog3").onmouseout = function() { this.style.backgroundColor = "#e3e4e6"; this.style.color = "#666666"; }
                            document.getElementById("acctog4").onmouseover = function() { this.style.backgroundColor = "#c1c3c8"; this.style.color = "#e1017b"; }
                            document.getElementById("acctog4").onmouseout = function() { this.style.backgroundColor = "#e3e4e6"; this.style.color = "#666666"; }
                            /**/document.getElementById("acctog5").onmouseover = function() { this.style.backgroundColor = "#c1c3c8"; this.style.color = "#e1017b"; }
                            /**/document.getElementById("acctog5").onmouseout = function() { this.style.backgroundColor = "#c1c3c8"; this.style.color = "#e1017b"; }
                            document.getElementById("acctog6").onmouseover = function() { this.style.backgroundColor = "#c1c3c8"; this.style.color = "#e1017b"; }
                            document.getElementById("acctog6").onmouseout = function() { this.style.backgroundColor = "#e3e4e6"; this.style.color = "#666666"; }
                            document.getElementById("acctog7").onmouseover = function() { this.style.backgroundColor = "#c1c3c8"; this.style.color = "#e1017b"; }
                            document.getElementById("acctog7").onmouseout = function() { this.style.backgroundColor = "#e3e4e6"; this.style.color = "#666666"; }
                            document.getElementById("acctog8").onmouseover = function() { this.style.backgroundColor = "#c1c3c8"; this.style.color = "#e1017b"; }
                            document.getElementById("acctog8").onmouseout = function() { this.style.backgroundColor = "#e3e4e6"; this.style.color = "#666666"; }
                            break;    
                            
                        case 6:
                            document.getElementById("wrapper").style.background = '#ffffff url(css/img/pozadi_01.jpg) no-repeat';

                            document.getElementById("acctog6").style.color = '#e1017b';
                            //document.getElementById("acctog5").style.background = '#000000';
                            //document.getElementById("acccon5").style.background = '#000000 url(css/img/zobacek5.gif) no-repeat';

                            /////////////////////////////////////////////////////////////
                            document.getElementById("acctog0").style.color = '#666666';
                            document.getElementById("acctog1").style.color = '#666666';
                            document.getElementById("acctog2").style.color = '#666666';
                            document.getElementById("acctog3").style.color = '#666666';
                            document.getElementById("acctog4").style.color = '#666666';
                            document.getElementById("acctog5").style.color = '#666666';
                            //document.getElementById("acctog6").style.color = '#666666';
                            document.getElementById("acctog7").style.color = '#666666';
                            document.getElementById("acctog8").style.color = '#666666';
                            document.getElementById("acctog0").style.background = '#e3e4e6';
                            document.getElementById("acctog1").style.background = '#e3e4e6';
                            document.getElementById("acctog2").style.background = '#e3e4e6';
                            document.getElementById("acctog3").style.background = '#e3e4e6';
                            document.getElementById("acctog4").style.background = '#e3e4e6';
                            document.getElementById("acctog5").style.background = '#e3e4e6';
                            //document.getElementById("acctog6").style.background = '#e3e4e6';
                            document.getElementById("acctog7").style.background = '#e3e4e6';
                            document.getElementById("acctog8").style.background = '#e3e4e6';
                            document.getElementById("acctog0").onmouseover = function() { this.style.backgroundColor = "#c1c3c8"; this.style.color = "#e1017b"; }
                            document.getElementById("acctog0").onmouseout = function() { this.style.backgroundColor = "#e3e4e6"; this.style.color = "#666666"; }
                            document.getElementById("acctog1").onmouseover = function() { this.style.backgroundColor = "#c1c3c8"; this.style.color = "#e1017b"; }
                            document.getElementById("acctog1").onmouseout = function() { this.style.backgroundColor = "#e3e4e6"; this.style.color = "#666666"; }
                            document.getElementById("acctog2").onmouseover = function() { this.style.backgroundColor = "#c1c3c8"; this.style.color = "#e1017b"; }
                            document.getElementById("acctog2").onmouseout = function() { this.style.backgroundColor = "#e3e4e6"; this.style.color = "#666666"; }
                            document.getElementById("acctog3").onmouseover = function() { this.style.backgroundColor = "#c1c3c8"; this.style.color = "#e1017b"; }
                            document.getElementById("acctog3").onmouseout = function() { this.style.backgroundColor = "#e3e4e6"; this.style.color = "#666666"; }
                            document.getElementById("acctog4").onmouseover = function() { this.style.backgroundColor = "#c1c3c8"; this.style.color = "#e1017b"; }
                            document.getElementById("acctog4").onmouseout = function() { this.style.backgroundColor = "#e3e4e6"; this.style.color = "#666666"; }
                            document.getElementById("acctog5").onmouseover = function() { this.style.backgroundColor = "#c1c3c8"; this.style.color = "#e1017b"; }
                            document.getElementById("acctog5").onmouseout = function() { this.style.backgroundColor = "#e3e4e6"; this.style.color = "#666666"; }
                            /**/document.getElementById("acctog6").onmouseover = function() { this.style.backgroundColor = "#c1c3c8"; this.style.color = "#e1017b"; }
                            /**/document.getElementById("acctog6").onmouseout = function() { this.style.backgroundColor = "#c1c3c8"; this.style.color = "#e1017b"; }
                            document.getElementById("acctog7").onmouseover = function() { this.style.backgroundColor = "#c1c3c8"; this.style.color = "#e1017b"; }
                            document.getElementById("acctog7").onmouseout = function() { this.style.backgroundColor = "#e3e4e6"; this.style.color = "#666666"; }
                            document.getElementById("acctog8").onmouseover = function() { this.style.backgroundColor = "#c1c3c8"; this.style.color = "#e1017b"; }
                            document.getElementById("acctog8").onmouseout = function() { this.style.backgroundColor = "#e3e4e6"; this.style.color = "#666666"; }
                            break;    

                        case 7:
                            document.getElementById("wrapper").style.background = '#ffffff url(css/img/pozadi_01.jpg) no-repeat';

                            document.getElementById("acctog7").style.color = '#e1017b';
                            document.getElementById("acctog7").style.background = '#000000';
                            
                            document.getElementById("acccon7").style.background = '#000000 url(css/img/zobacek5.gif) no-repeat';

                            /////////////////////////////////////////////////////////////
                            document.getElementById("acctog0").style.color = '#666666';
                            document.getElementById("acctog1").style.color = '#666666';
                            document.getElementById("acctog2").style.color = '#666666';
                            document.getElementById("acctog3").style.color = '#666666';
                            document.getElementById("acctog4").style.color = '#666666';
                            document.getElementById("acctog5").style.color = '#666666';
                            document.getElementById("acctog6").style.color = '#666666';
                            //document.getElementById("acctog7").style.color = '#666666';
                            document.getElementById("acctog8").style.color = '#666666';
                            document.getElementById("acctog0").style.background = '#e3e4e6';
                            document.getElementById("acctog1").style.background = '#e3e4e6';
                            document.getElementById("acctog2").style.background = '#e3e4e6';
                            document.getElementById("acctog3").style.background = '#e3e4e6';
                            document.getElementById("acctog4").style.background = '#e3e4e6';
                            document.getElementById("acctog5").style.background = '#e3e4e6';
                            document.getElementById("acctog6").style.background = '#e3e4e6';
                            //document.getElementById("acctog7").style.background = '#e3e4e6';
                            document.getElementById("acctog8").style.background = '#e3e4e6';
                            document.getElementById("acctog0").onmouseover = function() { this.style.backgroundColor = "#c1c3c8"; this.style.color = "#e1017b"; }
                            document.getElementById("acctog0").onmouseout = function() { this.style.backgroundColor = "#e3e4e6"; this.style.color = "#666666"; }
                            document.getElementById("acctog1").onmouseover = function() { this.style.backgroundColor = "#c1c3c8"; this.style.color = "#e1017b"; }
                            document.getElementById("acctog1").onmouseout = function() { this.style.backgroundColor = "#e3e4e6"; this.style.color = "#666666"; }
                            document.getElementById("acctog2").onmouseover = function() { this.style.backgroundColor = "#c1c3c8"; this.style.color = "#e1017b"; }
                            document.getElementById("acctog2").onmouseout = function() { this.style.backgroundColor = "#e3e4e6"; this.style.color = "#666666"; }
                            document.getElementById("acctog3").onmouseover = function() { this.style.backgroundColor = "#c1c3c8"; this.style.color = "#e1017b"; }
                            document.getElementById("acctog3").onmouseout = function() { this.style.backgroundColor = "#e3e4e6"; this.style.color = "#666666"; }
                            document.getElementById("acctog4").onmouseover = function() { this.style.backgroundColor = "#c1c3c8"; this.style.color = "#e1017b"; }
                            document.getElementById("acctog4").onmouseout = function() { this.style.backgroundColor = "#e3e4e6"; this.style.color = "#666666"; }
                            document.getElementById("acctog5").onmouseover = function() { this.style.backgroundColor = "#c1c3c8"; this.style.color = "#e1017b"; }
                            document.getElementById("acctog5").onmouseout = function() { this.style.backgroundColor = "#e3e4e6"; this.style.color = "#666666"; }
                            document.getElementById("acctog6").onmouseover = function() { this.style.backgroundColor = "#c1c3c8"; this.style.color = "#e1017b"; }
                            document.getElementById("acctog6").onmouseout = function() { this.style.backgroundColor = "#e3e4e6"; this.style.color = "#666666"; }
                            /**/document.getElementById("acctog7").onmouseover = function() { this.style.backgroundColor = "#c1c3c8"; this.style.color = "#e1017b"; }
                            /**/document.getElementById("acctog7").onmouseout = function() { this.style.backgroundColor = "#c1c3c8"; this.style.color = "#e1017b"; }
                            document.getElementById("acctog8").onmouseover = function() { this.style.backgroundColor = "#c1c3c8"; this.style.color = "#e1017b"; }
                            document.getElementById("acctog8").onmouseout = function() { this.style.backgroundColor = "#e3e4e6"; this.style.color = "#666666"; }
                            break;    

                        case 8:
                            document.getElementById("wrapper").style.background = '#ffffff url(css/img/pozadi_01.jpg) no-repeat';

                            document.getElementById("acctog8").style.color = '#e1017b';
                            //document.getElementById("acctog5").style.background = '#000000';
                            //document.getElementById("acccon5").style.background = '#000000 url(css/img/zobacek5.gif) no-repeat';

                            /////////////////////////////////////////////////////////////
                            document.getElementById("acctog0").style.color = '#666666';
                            document.getElementById("acctog1").style.color = '#666666';
                            document.getElementById("acctog2").style.color = '#666666';
                            document.getElementById("acctog3").style.color = '#666666';
                            document.getElementById("acctog4").style.color = '#666666';
                            document.getElementById("acctog5").style.color = '#666666';
                            document.getElementById("acctog6").style.color = '#666666';
                            document.getElementById("acctog7").style.color = '#666666';
                            //document.getElementById("acctog8").style.color = '#666666';
                            document.getElementById("acctog0").style.background = '#e3e4e6';
                            document.getElementById("acctog1").style.background = '#e3e4e6';
                            document.getElementById("acctog2").style.background = '#e3e4e6';
                            document.getElementById("acctog3").style.background = '#e3e4e6';
                            document.getElementById("acctog4").style.background = '#e3e4e6';
                            document.getElementById("acctog5").style.background = '#e3e4e6';
                            document.getElementById("acctog6").style.background = '#e3e4e6';
                            document.getElementById("acctog7").style.background = '#e3e4e6';
                            //document.getElementById("acctog8").style.background = '#e3e4e6';
                            document.getElementById("acctog0").onmouseover = function() { this.style.backgroundColor = "#c1c3c8"; this.style.color = "#e1017b"; }
                            document.getElementById("acctog0").onmouseout = function() { this.style.backgroundColor = "#e3e4e6"; this.style.color = "#666666"; }
                            document.getElementById("acctog1").onmouseover = function() { this.style.backgroundColor = "#c1c3c8"; this.style.color = "#e1017b"; }
                            document.getElementById("acctog1").onmouseout = function() { this.style.backgroundColor = "#e3e4e6"; this.style.color = "#666666"; }
                            document.getElementById("acctog2").onmouseover = function() { this.style.backgroundColor = "#c1c3c8"; this.style.color = "#e1017b"; }
                            document.getElementById("acctog2").onmouseout = function() { this.style.backgroundColor = "#e3e4e6"; this.style.color = "#666666"; }
                            document.getElementById("acctog3").onmouseover = function() { this.style.backgroundColor = "#c1c3c8"; this.style.color = "#e1017b"; }
                            document.getElementById("acctog3").onmouseout = function() { this.style.backgroundColor = "#e3e4e6"; this.style.color = "#666666"; }
                            document.getElementById("acctog4").onmouseover = function() { this.style.backgroundColor = "#c1c3c8"; this.style.color = "#e1017b"; }
                            document.getElementById("acctog4").onmouseout = function() { this.style.backgroundColor = "#e3e4e6"; this.style.color = "#666666"; }
                            document.getElementById("acctog5").onmouseover = function() { this.style.backgroundColor = "#c1c3c8"; this.style.color = "#e1017b"; }
                            document.getElementById("acctog5").onmouseout = function() { this.style.backgroundColor = "#e3e4e6"; this.style.color = "#666666"; }
                            document.getElementById("acctog6").onmouseover = function() { this.style.backgroundColor = "#c1c3c8"; this.style.color = "#e1017b"; }
                            document.getElementById("acctog6").onmouseout = function() { this.style.backgroundColor = "#e3e4e6"; this.style.color = "#666666"; }
                            document.getElementById("acctog7").onmouseover = function() { this.style.backgroundColor = "#c1c3c8"; this.style.color = "#e1017b"; }
                            document.getElementById("acctog7").onmouseout = function() { this.style.backgroundColor = "#e3e4e6"; this.style.color = "#666666"; }
                            /**/document.getElementById("acctog8").onmouseover = function() { this.style.backgroundColor = "#c1c3c8"; this.style.color = "#e1017b"; }
                            /**/document.getElementById("acctog8").onmouseout = function() { this.style.backgroundColor = "#c1c3c8"; this.style.color = "#e1017b"; }
                            break;    
                            
                        default:
          /*
                            document.getElementById("wrapper").style.background = '#ffffff url(css/img/pozadi_01.jpg) no-repeat';
                            
                            document.getElementById("acctog0").style.color = '#666666';
                            document.getElementById("acctog1").style.color = '#666666';
                            document.getElementById("acctog2").style.color = '#666666';
                            document.getElementById("acctog3").style.color = '#666666';
                            document.getElementById("acctog4").style.color = '#666666';
                            document.getElementById("acctog5").style.color = '#666666';
                            document.getElementById("acctog6").style.color = '#666666';
                            document.getElementById("acctog7").style.color = '#666666';
                            document.getElementById("acctog8").style.color = '#666666';

                            document.getElementById("acctog0").style.background = '#e3e4e6';
                            document.getElementById("acctog1").style.background = '#e3e4e6';
                            document.getElementById("acctog2").style.background = '#e3e4e6';
                            document.getElementById("acctog3").style.background = '#e3e4e6';
                            document.getElementById("acctog4").style.background = '#e3e4e6';
                            document.getElementById("acctog5").style.background = '#e3e4e6';
                            document.getElementById("acctog6").style.background = '#e3e4e6';
                            document.getElementById("acctog7").style.background = '#e3e4e6';
                            document.getElementById("acctog8").style.background = '#e3e4e6';

                            document.getElementById("test-accordion").style.opacity = '1.00';
                            document.getElementById("test-accordion").style.filter = 'alpha(opacity=100)';
                            document.getElementById("test-accordion").style.MozOpacity = '1.0';
                            document.getElementById("test-accordion").style.KhtmlOpacity = '1.0';
                            
                            document.getElementById("acctog0").style.opacity = '1.00';
                            document.getElementById("acctog0").style.filter = 'alpha(opacity=100)';
                            document.getElementById("acctog0").style.MozOpacity = '1.00';
                            document.getElementById("acctog0").style.KhtmlOpacity = '1.00';

                            document.getElementById("acctog6").style.opacity = '1.00';
                            document.getElementById("acctog6").style.filter = 'alpha(opacity=100)';
                            document.getElementById("acctog6").style.MozOpacity = '1.00';
                            document.getElementById("acctog6").style.KhtmlOpacity = '1.00';
                            
                            document.getElementById("acctog0").onmouseover = function() { this.style.backgroundColor = "#c1c3c8"; this.style.color = "#e1017b"; }
                            document.getElementById("acctog0").onmouseout = function() { this.style.backgroundColor = "#e3e4e6"; this.style.color = "#666666"; }
                            document.getElementById("acctog1").onmouseover = function() { this.style.backgroundColor = "#c1c3c8"; this.style.color = "#e1017b"; }
                            document.getElementById("acctog1").onmouseout = function() { this.style.backgroundColor = "#e3e4e6"; this.style.color = "#666666"; }
                            document.getElementById("acctog2").onmouseover = function() { this.style.backgroundColor = "#c1c3c8"; this.style.color = "#e1017b"; }
                            document.getElementById("acctog2").onmouseout = function() { this.style.backgroundColor = "#e3e4e6"; this.style.color = "#666666"; }
                            document.getElementById("acctog3").onmouseover = function() { this.style.backgroundColor = "#c1c3c8"; this.style.color = "#e1017b"; }
                            document.getElementById("acctog3").onmouseout = function() { this.style.backgroundColor = "#e3e4e6"; this.style.color = "#666666"; }
                            document.getElementById("acctog4").onmouseover = function() { this.style.backgroundColor = "#c1c3c8"; this.style.color = "#e1017b"; }
                            document.getElementById("acctog4").onmouseout = function() { this.style.backgroundColor = "#e3e4e6"; this.style.color = "#666666"; }
                            document.getElementById("acctog5").onmouseover = function() { this.style.backgroundColor = "#c1c3c8"; this.style.color = "#e1017b"; }
                            document.getElementById("acctog5").onmouseout = function() { this.style.backgroundColor = "#e3e4e6"; this.style.color = "#666666"; }
                            document.getElementById("acctog6").onmouseover = function() { this.style.backgroundColor = "#c1c3c8"; this.style.color = "#e1017b"; }
                            document.getElementById("acctog6").onmouseout = function() { this.style.backgroundColor = "#e3e4e6"; this.style.color = "#666666"; }
                            document.getElementById("acctog7").onmouseover = function() { this.style.backgroundColor = "#c1c3c8"; this.style.color = "#e1017b"; }
                            document.getElementById("acctog7").onmouseout = function() { this.style.backgroundColor = "#e3e4e6"; this.style.color = "#666666"; }
                            document.getElementById("acctog8").onmouseover = function() { this.style.backgroundColor = "#c1c3c8"; this.style.color = "#e1017b"; }
                            document.getElementById("acctog8").onmouseout = function() { this.style.backgroundColor = "#e3e4e6"; this.style.color = "#666666"; }

         */                   

                    }
                    //alert(i);
                    
                }
            }
            // <- TN //
            ///////////
        }
    },

    checkMaxHeight: function() {
        for(var i=0; i<this.contents.length; i++) {
            if(this.contents[i].getHeight() > this.maxHeight) {
                this.maxHeight = this.contents[i].getHeight();
            }
        }
    },

    attachInitialMaxHeight: function() {
		this.current.previous('div.'+this.options.toggleClass).addClassName(this.options.toggleActive);
        if(this.current.getHeight() != this.maxHeight) this.current.setStyle({height: this.maxHeight+"px"});
    },

    clickHandler: function(e) {
        var el = e.element();
        //alert( this.current == this.contents[0] );
        if(el.hasClassName(this.options.toggleClass) && !this.isAnimating) {
            this.expand(el);
        }
    },

    initialHide: function(){
        for(var i=0; i<this.contents.length; i++){
            if(this.contents[i] != this.current) {
                this.contents[i].hide();
                this.contents[i].setStyle({height: 0});
            }
        }
    },

    animate: function() {
        var effects = new Array();
        var options = {
            sync: true,
            scaleFrom: 0,
            scaleContent: false,
            transition: Effect.Transitions.sinoidal,
            scaleMode: {
                originalHeight: this.maxHeight,
                originalWidth: this.accordion.getWidth()
            },
            scaleX: false,
            scaleY: true
        };
        
        effects.push(new Effect.Scale(this.toExpand, 100, options));

        options = {
            sync: true,
            scaleContent: false,
            transition: Effect.Transitions.sinoidal,
            scaleX: false,
            scaleY: true
        };

        effects.push(new Effect.Scale(this.current, 0, options));

        var myDuration = 0.75;

        new Effect.Parallel(effects, {
            duration: myDuration,
            fps: 35,
            queue: {
                position: 'end',
                scope: 'accordion'
            },
            beforeStart: function() {
                this.isAnimating = true;
                this.current.previous('div.'+this.options.toggleClass).removeClassName(this.options.toggleActive);
                this.toExpand.previous('div.'+this.options.toggleClass).addClassName(this.options.toggleActive);
            }.bind(this),
            afterFinish: function() {
                this.current.hide();
                this.toExpand.setStyle({ height: this.maxHeight+"px" });
                this.current = this.toExpand;
                this.isAnimating = false;
            }.bind(this)
        });
               
    }

});


document.observe("dom:loaded", function(){
    accordion = new Accordion("test-accordion", 9);
})
