var iActual = -1;
      		
      		

$(document).ready(function() {
  	
  	$('.menu a').mouseover(function(){
     
   		var sTitle = $(this).attr('title');
	
		if(sTitle != ''){
       			
       			$('.submenu ul').hide();
       			
       			$('.submenu .'+sTitle).show();
       			
     		}		
   		
	   });
	   
	   
	   
	   
  	$('.l').click(function(){
      		
      		
      		
      		if(iActual > 0){
          		iActual--;
          		var iLeft = iActual * 250 * (-1);
          		//$('.logos').css('left', iLeft+'px');
          		
          		$('.logos').animate({left: iLeft+'px'}, 500, function() {});

		}
		
	
      		
	});
	
	
		   
  	$('.r').click(function(){	
		if(iActual < iTotal){
          		iActual++;
          		var iLeft = iActual * 250 * (-1);
          		$('.logos').animate({left: iLeft+'px'}, 500, function() {});
          		
          		
		}
	});
	
	
	$(window).resize(function() {
 		resize();
	});

	
	
 	Cufon.replace('.menu ul li a');
    	Cufon.replace('.submenu ul li a');
    	Cufon.replace('.box h1'); 

	var iWidth = $(window).width();
	
	var iLeft = 0;
	
	if(iWidth > 1280){
	  	
	  	iLeft = Math.floor((iWidth-1280)/2); 
	  
	  	iWidth = 1280;
	  	
	  	
	  	
	}
	
	if(iWidth < 980){
		  	iWidth = 980;
		}
	
	//alert(sRotator);
	$('#slideshowHolder').append(sRotator);
	
	$('.slider').css('left', iLeft+'px');
	$('#slideshowHolder').jqFancyTransitions({ width: iWidth, height: 510 });
	$('.slider').css('width', iWidth+'px');
	Cufon.replace('#slideshowHolder h1');
	Cufon.replace('#slideshowHolder h2');
	
  	
});


function startRotate(){
  
  	iActual++;
  	
  	if(iActual > iTotal){
     		iActual = 0;
   	}
  	
	var iLeft = iActual * 253 * (-1);
	$('.logos').animate({left: iLeft+'px'}, 500, function() {});
	
	var iTime = setTimeout('startRotate()',3000)
  	
}



hs.graphicsDir = 'http://proscenium.pl/_library/highslide/highslide/graphics/';
hs.align = 'center';
hs.transitions = ['expand', 'crossfade'];
//hs.outlineType = 'rounded-white';
hs.fadeInOut = true;
hs.wrapperClassName = 'colored-border';

if (hs.addSlideshow) hs.addSlideshow({
	//slideshowGroup: 'group1',
	interval: 5000,
	repeat: false,
	useControls: true,
	fixedControls: 'fit',
	overlayOptions: {
		opacity: .6,
		position: 'bottom center',
		hideOnMouseOut: true
	}
});




function resize(){
  	var iWidth = $(window).width();

	var iLeft = 0;

	if(iWidth > 1280){
	  
	  	iLeft = Math.floor((iWidth-1280)/2); 
	  	
	  	iWidth = 1280;
	  	
	  	
	}
	
	if(iWidth < 980){
	  	iWidth = 980;
	}
	
	$('.slider').css('left', iLeft+'px');

	$('#slideshowHolder').jqFancyTransitions({ width: iWidth, height: 510 });
	$('.slider').css('width', iWidth+'px');
  
}

