
var arrowpos = [-15,-20];
var timing = 350;
var subelem = false; 
window.addEvent('domready', function(){
	if($('blogBox'))
	{
		$('blogBox').addEvents({
			'mouseenter': function(){
				this.setStyles({'visibility':'visible', 'display':'block'});
			},
			'mouseleave': function(){
				this.setStyles({'visibility':'hidden', 'display':'none'});
			}
		});						
		$('bloglink').addEvents({
			'mouseenter': function(){
				$('blogBox').setStyles({'visibility':'visible', 'display':'block'});
			},
			'mouseleave': function(){
				$('blogBox').setStyles({'visibility':'hidden', 'display':'none'});
			}
		});
	}
	$$('.arrowBox').each(function(elem){
		
		var arrow = elem.getElement('.arrow');
		if(arrow)
		{
			arrow.set('morph', {
							'duration': timing, 
							'transition': Fx.Transitions.Quad.easeInOut
					});
			elem.addEvents({
				'mouseenter': function(){
					arrow.morph({'right': arrowpos[1]});
					arrow.get('morph').addEvent('complete', function(){
						var to = $(arrow).getStyle('right').toInt() == arrowpos[1] ? arrowpos[0] : arrowpos[1];
						arrow.morph({'right': to});	
					});								
				},	
				'mouseleave': function(){
					arrow.get('morph').removeEvents('complete');
					arrow.morph({'right': arrowpos[0]});
				}
			});
		}
		
	});
        
	$("mainMenu").getElements('li').each(function(elem){
	
        elem.addEvents({
        	'mouseenter': function(){
                this.setStyles({
                    'background-image': 'url(/images_v2/menuSelection.jpg)'
                });
    			if(this.getElement('ul'))
                {
                    this.getElement('ul').setStyle('display', 'block');
                }
            
            },
            'mouseleave': function(){
                this.setStyles({
                    'background-image': 'none'
                });           
                if(this.getElement('ul'))
                {
                    this.getElement('ul').setStyle('display', 'none');      
                }
            }
        });				
    });
    
    
});

