	$(document).ready(function(){
		var aktPromo,
			projekt;
		$('#apDiv5').itemCarousel({
			'hoverClass':null,
			'change':function(element){		
				aktPromo = element.filter(':visible');
						
				if($('#schublade').css('left') == '0px'){
					projekt = aktPromo.find('img').attr('alt');
					$('#promocontent').empty().load(projekt+'.htm');
				}
			},
			'init':function(element){
				aktPromo = $('#start');
				projekt = aktPromo.find('img').attr('alt');
				$('#promocontent').empty().load(projekt+'.htm');
			}
		});

		$('#info').click(function(){	
			projekt = aktPromo.find('img').attr('alt');
			$('#promocontent').load(projekt+'.htm');
			$('#schublade').animate({
				left: '0'
			},1000);
			
		});
		closelayer = function(){
			$('#schublade').animate({left: '-222px'},1000, function() {
    			$('#promocontent').empty();
  			});			
		}
		loadbigcontent = function(content){
			var navitems = $('#nav span');
			navitems.each(function(i,val){
				$(val).removeClass('active');
			});
			$('#'+content).addClass('active');
			if($('#biglayer').css('right') == 0){
				$('#biglayer').empty().load(content)
			}else{
				$('#biglayer').load(content).animate({
					right: 0
				},1000);
			}
		}
		closebiglayer = function(content){
			$('#biglayer').animate({right: '-508px'},1000, function() {
    			$('#biglayer').empty();
  			});		
			var navitems = $('#nav span');
			navitems.each(function(i,val){
				$(val).removeClass('active');
			});
			if(content == 'home'){				
				$('#home').addClass('active');
			}	
		}

		$('#apDiv1').itemCarousel({
			'hoverClass':null,
			'viewCount': 1,
			'scrollInterval': 6000,
			'autoScroll': true,
		});		

		if( $('#scrollarea').css('height').replace(/px/g,'') > 160){
			
			$('.scroll-bar').slider({
				orientation: 'vertical',
				value: 10,
				min: 0,
				max: 10,
				step:1,
				slide: function(event, ui) { 
					var contentheight = $('#scrollarea').height()-$('#news').height(),
						scrollvalue = 10-parseInt(ui['value']),
						scrollrange = parseInt((contentheight/10)*scrollvalue);				
					$('#scrollarea').css('top', '-'+scrollrange+'px');
				
				}
		
			});
			
		}		
	});
	
		
	
