jQuery(function($) {
	
	$(".ui-slideshow").slideshow({
		settings: {
			groupName:'company', dir:'v', 
			firstItem: 0, randomFill: false,
			itemsPerSlide: 1, spaceBetwenItems: 0,
			autoplay:true, showtime: 5000, animation: 'fade'
		},
		
		onLowSlideLength: function(btns, len) {},
		buttons: {
			".ui-slideshow-top": { animation: "slideTop", event:'click', action:'nextSlide'},
			".ui-slideshow-bottom": { animation: "slideBottom", event:'click', action:'prevSlide'},
			".ui-slideshow-next": { animation: "slideNext", event:'click', action:'nextSlide'},
			".ui-slideshow-prev": { animation: "slidePrev", event:'click', action:'prevSlide'},
			".ui-slideshow-item": { animation: "fade", event: 'click', action:'showSlideByItem'}
		},
		onShow: function(slide, self) {},
		animations: lib.animations

	})
    
   	/* * * * * 
	 * AJAXIFY NEWS SUBSCRIPTION
	** * */      
         
    $('.doAjax').ajaxify({       
        handleError: function(error) {  
            if($('#form-global-error').length!=0)return;
        	$('<span id="form-global-error">'+error+'</span>').appendTo('.form-error');             
        	setTimeout(function() {    
        		$('#form-global-error').fadeOut('fast', function() {    
        			$(this).remove();    
        		});    
        	}, 3500);            	    
        },
        handleSuccess : function(message, self){
            if($('#form-global-success').length!=0)return;
       	    $('<span id="form-global-success">'+message+'</span>').appendTo('.form-success');             
        	setTimeout(function() {    
        		$('#form-global-success').fadeOut('fast', function() {    
        			$(this).remove();    
        		});    
        	}, 3500); 
        	self.d.form.node[0].reset();              
        },
        bind:"click",	    
        dataType:"json",    
        target:".form-success",    
        beforeSend: function(){              
        	//var bool = validate($('#news_subscription')[0],'lang');    
        	//if(!bool) this.handleError('Prišlo je do napake!');           
        	//return bool;     
        
        },        
        success: function(data, self) {            
            if(data['error'])this.handleError(data['error']); 
            if(data['message'])this.handleSuccess(data['message'], self);                    
        	return false;    
        }    
    }).append('<input type="hidden" name="ishuman" value="humanformvalidate"/>');
	
	
//	$('.ajaxxx').divbox({
//		type: 'ajax',
//		width: 600, height: 400
//	});
//	$('.lightbox').divbox();
//	$('.lightbox').divbox({caption: true, caption_control: false});
	
	
});
window.addEvent('domready', function(){
	//call multiBox
	var initMultiBox = new multiBox({
		mbClass: '.ajaxxx',//class you need to add links that you want to trigger multiBox with (remember and update CSS files)
		container: $(document.body),//where to inject multiBox
		//descClassName: 'multiBoxDesc',//the class name of the description divs
		path: './Files/',//path to mp3 and flv players
		useOverlay: true,//use a semi-transparent background. default: false;
		maxSize: {w:800, h:600},//max dimensions (width,height) - set to null to disable resizing
		addDownload: false,//do you want the files to be downloadable?
		pathToDownloadScript: './Scripts/forceDownload.asp',//if above is true, specify path to download script (classicASP and ASP.NET versions included)
		addRollover: false,//add rollover fade to each multibox link
		addOverlayIcon: false,//adds overlay icons to images within multibox links
		addChain: false,//cycle through all images fading them out then in
		recalcTop: true,//subtract the height of controls panel from top position
		addTips: false,//adds MooTools built in 'Tips' class to each element (see: http://mootools.net/docs/Plugins/Tips)
		autoOpen: 0//to auto open a multiBox element on page load change to (1, 2, or 3 etc)
	});
});

