 /************************************************************************************************************
        (C) www.dhtmlgoodies.com, October 2005

        ************************************************************************************************************/

        /* Update LOG

        January, 28th - Fixed problem when double clicking on a pane(i.e. expanding and collapsing).

        */
        var xpPanel_slideActive = true;        // Slide down/up active?
        var xpPanel_slideSpeed = 5;        // Speed of slide
        var xpPanel_onlyOneExpandedPane = false;        // Only one pane expanded at a time ?

        var xpPane;
        var paneIndex;

        var savedActivePane = false;
        var savedActiveSub = false;

        var xpPanel_currentDirection = new Array();


        var currentlyExpandedPane = false;

        /*
        These cookie functions are downloaded from
        http://www.mach5.com/support/analyzer/manual/html/General/CookiesJavaScript.htm
        */


        function cancelXpWidgetEvent()
        {
                return false;

        }
        function showPaneContent(e,inputObj,id_fin)
        {

               if(!inputObj)inputObj = this;

                var obj = document.getElementById('paneContent' + id_fin);
              if(document.getElementById('fs'+id_fin)!=null)
                        document.getElementById('fs'+id_fin).className='';
                     if(document.getElementById('img'+id_fin)!=null)
                        document.getElementById('img'+id_fin).src='images/slidedown/slidedown_close.gif';
                        if(this)
                        {
                                if(currentlyExpandedPane && xpPanel_onlyOneExpandedPane)showHidePaneContent(false,currentlyExpandedPane);
                                currentlyExpandedPane = this;
                        }
                        else{
                                currentlyExpandedPane = false;
                        }

                        if(xpPanel_slideActive)
                        {
                                 obj.style.display='block';
                                if(document.all)
                                {
                                        obj.style.height = '1px';
                                }

                                //alert(obj.id);
                                xpPanel_currentDirection[obj.id] = xpPanel_slideSpeed;
                                slidePane(xpPanel_slideSpeed,obj.id,id_fin);
                        }
                        else
                        {
                                obj.style.display='block';
                                subDiv = obj.getElementsByTagName('DIV')[0];
                                obj.style.height = subDiv.offsetHeight + 'px';
                        }

        }
        function showHidePaneContent(e,inputObj,id_fin)
        {
                if(!inputObj)inputObj = this;

                var obj = document.getElementById('paneContent' + id_fin);

                if(obj.offsetHeight>1 && obj.offsetHeight<=parseInt(obj.style.height))
                {
                        currentlyExpandedPane = false;
                        if(xpPanel_slideActive){
                                obj.style.display='block';
                                xpPanel_currentDirection[obj.id] = (xpPanel_slideSpeed*-1);
                                slidePane((xpPanel_slideSpeed*-1), obj.id,id_fin);
                        }else{
                                obj.style.display='none';
                        }

                }
                else
                {
                     if(document.getElementById('fs'+id_fin)!=null)
                        document.getElementById('fs'+id_fin).className='';
                     if(document.getElementById('img'+id_fin)!=null)
                        document.getElementById('img'+id_fin).src='images/slidedown/slidedown_close.gif';
                        if(this)
                        {
                                if(currentlyExpandedPane && xpPanel_onlyOneExpandedPane)showHidePaneContent(false,currentlyExpandedPane);
                                currentlyExpandedPane = this;
                        }
                        else{
                                currentlyExpandedPane = false;
                        }

                        if(xpPanel_slideActive)
                        {
                                 obj.style.display='block';
                                if(document.all)
                                {
                                        obj.style.height = '1px';
                                }

                                //alert(obj.id);
                                xpPanel_currentDirection[obj.id] = xpPanel_slideSpeed;
                                slidePane(xpPanel_slideSpeed,obj.id,id_fin);
                        }
                        else
                        {
                                obj.style.display='block';
                                subDiv = obj.getElementsByTagName('DIV')[0];
                                obj.style.height = subDiv.offsetHeight + 'px';
                        }

                }
                return true;
        }

        function showContinuousPaneContent(e,inputObj,id_fin)
        {

                                currentlyExpandedPane = true;
                       if(!inputObj)inputObj = this;

                var obj = document.getElementById('paneContent' + id_fin);

                        if(xpPanel_slideActive)
                        {
                                 obj.style.display='block';
                              /*  if(document.all)
                                {
                                        obj.style.height = '1px';
                                }   */

                                //alert(obj.id);
                                xpPanel_currentDirection[obj.id] = xpPanel_slideSpeed;
                                slidePane(xpPanel_slideSpeed,obj.id,id_fin);
                        }
                        else
                        {
                                obj.style.display='block';
                                subDiv = obj.getElementsByTagName('DIV')[0];
                                obj.style.height = subDiv.offsetHeight + 'px';
                        }

                return true;
        }

        function slidePane(slideValue,id,id_fin)
        {
                if(slideValue!=xpPanel_currentDirection[id]){
                        return false;
                }
                var activePane = document.getElementById(id);
                if(activePane==savedActivePane){
                        var subDiv = savedActiveSub;
                }else{
                        var subDiv = activePane.getElementsByTagName('DIV')[0];
                }
                savedActivePane = activePane;
                savedActiveSub = subDiv;

                var height = activePane.offsetHeight;
                var innerHeight = subDiv.offsetHeight;
                height+=slideValue;
                if(height<0)height=0;
                if(height>innerHeight)height = innerHeight;


                if(document.all){
                        activePane.style.filter = 'alpha(opacity=' + Math.round((height / subDiv.offsetHeight)*100) + ')';
                }else{
                        var opacity = (height / subDiv.offsetHeight);
                        if(opacity==0)opacity=0.01;
                        if(opacity==1)opacity = 0.99;
                        activePane.style.opacity = opacity;
                }

                if(slideValue<0)
                {

                        activePane.style.height = height + 'px';
                        subDiv.style.top = height - subDiv.offsetHeight + 'px';

                        if(height>0)
                        {

                                setTimeout('slidePane(' + slideValue + ',"' + id + '","' + id_fin + '")',10);
                        }
                        else
                        {
                                if(document.all)
                                   activePane.style.display='none';
                                if(document.getElementById('fs'+id_fin)!=null)
                                   document.getElementById('fs'+id_fin).className='invisible';
                                if(document.getElementById('img'+id_fin)!=null)
                                   document.getElementById('img'+id_fin).src='images/slidedown/slidedown_open.gif';
                        }
                }
                else
                {
                        subDiv.style.top = height - subDiv.offsetHeight + 'px';
                        activePane.style.height = height + 'px';
                        if(height<innerHeight){
                                setTimeout('slidePane(' + slideValue + ',"' + id + '","' + id_fin + '")',10);
                        }
                }




        }