// JavaScript Document
//domain = ((domain.get('scheme')+'/'+domain.get('host')));
function f(x) {
    if (document.getElementById(x)) {
        if (document.getElementById(x).style.display == 'block') {
            document.getElementById(x).style.display = 'none';
        }
        else {
            document.getElementById(x).style.display = 'block';
        }
    }
}
	function slide(outer, inner, items){
			new SlideItMoo({
						overallContainer: outer,
						elementScrolled: inner,
						thumbsContainer: items,		
						itemsVisible:3,
						elemsSlide:3,
						duration:200,
						itemsSelector: '.box',
						itemWidth: 223,
						showControls:1,
						onChange: function(index){
							
						}
			
			});
	}
function playButton(el,width,height){
	var imgPath = '../public/design/frontend/images/play/play.png';	
	var imgPathIe = '../public/design/frontend/images/play/playie.png';	
	el = $$(el);
	
	
	el.each(function(v,i){
		v.setStyle('position','relative');
		v.setStyle('display','block');
		var buton = new Element('img',{
								'src':imgPath,
								'styles':{
									'position':'absolute',
									'top':(height / 2)-40,
									'left':(width / 2)-30,
									'opacity':.6
								},
								'class':'playButton'
							});
		if(!Browser.Engine.trident){
			v.addEvent('mouseenter',function(){
						//					 this.getElement('.playButton').setStyle('opacity',1);
											 var tween1 = new Fx.Tween( this.getElement('.playButton'),{duration: 'short', wait:false});
											 tween1.start('opacity',[0.6],[1]);
											 });
			v.addEvent('mouseleave',function(){
											 var tween2 = new Fx.Tween( this.getElement('.playButton'),{duration: 'short', wait:false});
											 tween2.start('opacity',[1],[.6]);
											 });
		}else{
			buton.setStyle('opacity',1);	
			buton.set('src',imgPathIe);	
			v.addEvent('mouseenter',function(){
											buton.set('src',imgPath);	
											});
			v.addEvent('mouseleave',function(){
											buton.set('src',imgPathIe);												
											});
			
		}
		v.grab(buton);	
	});
}

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);
	}
	
	if($$('.playmovie'))playButton('.playmovie',200,140);
});


