/* CREDITS
 * ----------------------------------------------------------
 * Title:		WEBSITE - Main Javascript file
 * Author:		Inventis <info@inventis.be>
 * Date:		00/00/0000
 * Last Edit:	00/00/0000 [Author]
 * ----------------------------------------------------------
 * Inventis - Web Architects - We design the Web!
 * www.inventis.be
 */
window.addEvent('domready', function(){

    if ($('legendSwitcher')) {
        var mySlide = new Fx.Slide('legendSwitcher').hide();
        $('legendSwitcher').setStyle('display', 'block');
        
        $('legendSwitch').addEvent('click', function(el){
            el.stop();
            mySlide.toggle();
        });
    }
    
    if (document.getElement('div.cartpopup')) {
    
        var div = $$('div.cartpopup');
        var divClone = $$('div.cartpopup').clone().setStyles({
            'display': 'none',
            'opacity': '0'
        });
        divClone.inject(document.body, 'bottom');
        div.destroy();
        
        divClone.setStyle('display', 'block');
        var overLay = new Element('div', {
            'class': 'cartOverlay'
        }).inject(document.body, 'bottom');
        
        overLay.setStyle('height', window.getScrollSize().y);
        divClone.set('opacity', 1);
    }
    
    $each($$('a.help'), function(e){
        e.getFirst('strong').setStyle('display', 'none');
        
        e.addEvent('mouseover', function(i){
            e.getFirst('strong').setStyle('display', 'block');
		});
		
		e.addEvent('mouseout', function(j){
			e.getFirst('strong').setStyle('display', 'none');
		});
    });
});
