// JavaScript Document
var debug=true;
function mylog(html){
    if(debug==false) {
        return;
    }
    
    if($('tools_lista')) {
        var logbox = new Element('div',{'id':'tools_logBox'});
        logbox.set('text',html);
        $('tools_lista').adopt(logbox);
    }
}

//domain = ((domain.get('scheme')+'/'+domain.get('host')));
function slide(outer, inner, items){
    if(!$(outer)) {
        return;
    }
    
    new SlideItMoo({
        overallContainer: outer,
        elementScrolled: inner,
        thumbsContainer: items,		
        itemsVisible:1,
        elemsSlide:1,
        duration:200,
        itemsSelector: '.item',
        itemWidth: 170,
        showControls:1,
        onChange: function(index){
            
        }
    });
}

function hidePanel(el, container, offset){
	$$(el).each(function(v,i){
		var hideButton = new Element('div',{
									 'class':'hideButton opened',
									 'html':'&gt;',
									 'events': {
											'click': function(){
												if(this.hasClass('opened')){
													v.setStyle('right',offset);
													this.removeClass('opened');
													this.set('html','&lt;');
												}else{
													v.setStyle('right',0);
													this.addClass('opened');
													this.set('html','&gt;');
												}
											}
									 }
								});
		
		$$(container).adopt(hideButton);
	});
}
		

window.addEvent('domready', function(){
    /* SMOOTHBOX */
    $$('.smoothbox').set('rel','lightbox');
    /* /end of SMOOTHBOX */
    // zastępuje target=_blank	
    $$('.targetBlank').addEvent('click', function(e){
        e.stop();
		targetBlank(this);
	});
    /* menu gorne*/
	if($$('#menu_top')){
	   var menuItems = $$('#menu_top').getElements('li');
       var active = $$('.activ');
       fadingMenu($$(menuItems), active);
	}
    
	//hidePanel('#modArticle .art', '#modArticle', -300);	
	
});


