   var menuEffects = new Class({
                initialize: function(selector, options) {
                    this.options = Object.extend({
                        subElement: false,
                        subElementSelector: 'a'
                    }, options || {})
                    this.selector = selector;
                    this.currTimer = 500;
                    $ES(selector + ' li ul').each(function(el) {
                        el.setStyles({
                            'display': 'block'
                        });
                        normalHeight = el.offsetWidth;
                        el.setStyles({
                            'height': el.offsetHeight,
                            'width': 0,
                            'overflow': 'hidden'
                        });
                        elParent = $(el.parentNode);
                        
                        currentMenu = new Fx.Style(el, 'width', {duration:250, wait:false});
                        elParent.addEvents({
                            'mouseover': function(submenu, myParent, targetValue) {
                                myParent.addClass('hover');
                                submenu.clearTimer();
                                submenu.custom(targetValue);
                            }.pass([currentMenu, elParent, normalHeight]),
                            'mouseout': function(submenu, myParent, targetValue) {
                                myParent.removeClass('hover');
                                submenu.clearTimer();
                                submenu.custom(targetValue);
                            }.pass([currentMenu, elParent, 0])
                        })
                    }.bind(this));
                }
            });
            function showResponse(request,r2){
                alert(request);
            };
            var adIsOpen=false;
            var adNum=1;
            var refresh = (function() {
                //	$('ads_c').appendText('test');
                //ajax.request(dummy); 
                //manager/media/script/mootools/
	
                //	var myRequest = new Request({method: 'get', url: 'index.php?id=56',onSuccess: function(responseText, responseXML) {
                //  alert(responseText); // Alerts the server date (for example, 'Thu, 26 Feb 2009 20:26:06 GMT')
                //}});
                //new XHR({method: 'get', onComplete:showResponse}).send(/'index.php?id=56', '');

                pathArray = document.location.href.split( '/' );
                var myXHR = new XHR({  
                    method: 'get',  
                    onSuccess: function(){  
                   
                        var html = myXHR.response.text;  
                        var myEffect = new Fx.Styles('ads_c',  {duration: 2000, transition: Fx.Transitions.Quart.easeInOut}).addEvent('onComplete', function() {
                            //alert('telos');
                            var commentsEffect = new Fx.Styles('comment_panel',  {duration: 3000, transition: Fx.Transitions.Quart.easeInOut});
                            commentsEffect.start({
                                'width': [0, 345] //Morphs the 'height' style from 10px to 100px.
                            });
                        });
	
	
                        //	 alert('ela:'+html);
	 
                        if(!adIsOpen){
                            $('ads_c').setHTML(html);
                            $('ads_c').setStyles({
                                'height': 0,
                               
                                'overflow': 'hidden'
                            });
  
                            myEffect.start({
                                'height': [0, 270], //Morphs the 'height' style from 10px to 100px.
                                'opacity': [0, 1]
                            });

                            adIsOpen=true;
                        }else{
	
                            var hideAdd = new Fx.Styles('ads_c',  {duration: 800, transition: Fx.Transitions.linear}).addEvent('onComplete', function(){
                                //alert('done:'+html);
                                if(html.toString()=='<p><p>No documents found.</p></p>') adNum=1;
                                else
                                    $('ads_c').setHTML( html);
                                var showAdd = new Fx.Styles('ads_c',  {duration: 800, transition: Fx.Transitions.linear}).addEvent('onComplete', function() {
                                    //alert('telos');
                                    var commentsEffect = new Fx.Styles('comment_panel',  {duration: 3000, transition: Fx.Transitions.Quart.easeInOut});
                                    commentsEffect.start({
                                        'width': [0, 345] //Morphs the 'height' style from 10px to 100px.
                                    });
                                });
                                showAdd.start({'opacity': [0, 1]});

                            }
                        );
		
                            hideAdd.start({'opacity': [1, 0]});
                        }

				

                        //         alert(myString);  
                   
                        //I'm expecting three results back, one for each div.  
                        //I also know where they are in the array (0,1 and 2 respectively)  
                   
                 
                  
                    } 
          
                }).send('http://'+pathArray[2]+'/index.php?id=56&te=4&browser_start='+adNum, '');
                //alert(';q:'+document.location.href+'--'+pathArray[2]);
                ++adNum;
                //myRequest.send('name=john&lastname=dorian');

                //new ajax('ajax1.php',{postBody:'answerme=ok', onComplete: showResponse, update:'ads_c'}).request();
	
                //return false;

            }); 

            function processMenuEffects (){
                var myMenus = new menuEffects('#myajaxmenu', {
                    subElement: true
                });
                refresh();
                periodical = refresh.periodical(8000, this); 

            }


            window.onDomReady(processMenuEffects);
