/* Author: Foxrocket Media
*/

$(document).ready(function() {
		// let's do some preloading !
		$('#uk-banner').show();
		$('#uk-banner').append('<h1 class="loading">loading ..</h1>');
		$.preLoadImages(
		     [
						'images/bridge.jpg',
						'images/invoicing.jpg',
						'images/document.jpg',
						'images/bank.jpg'
		     ],function(){
						//alert('I am Ready !');
						$('h1.loading').remove();
						$ukbanner.init();
		     }
		);
});


$ukbanner = {
	
	init: function() {
		this.invoicing();
	}, 
	
	invoicing: function() {
		$('#uk-banner').empty();
		
		bg = $('<div></div>').hide().addClass('bg-invoicing');
		el = $('<h1>e-facturation et automatisation de comptabilité fournisseurs</h1>').hide();
		bg.append(el);
		ex = $('<div></div>').hide().addClass('expander');
		el = $("<h2>Éliminez le papier de vos systèmes et optimisez<br />l'automatisation de bout en bout des processus</h2>").hide();
		ex.append(el);
		bg.append(ex);
		button = $('<a href="http://www.bottomline.fr/solutions/gestion_des_transactions/index.html">Savoir Plus &rarr;</a>').hide();
		bg.append(button);
		
		$('#uk-banner').append(bg);
		
		bg.fadeIn(2000);
		$('#uk-banner h1').fadeIn(2000, function(){
			ex.fadeIn().animate({width: 324, left: '2%'}, 1000).animate({width: 294, left: '4%'}, 800, function(){
				$('h2').fadeIn('slow', function(){
					button.fadeIn('slow', function(){
						bg.delay(4000).fadeOut(2000, function(){
								$ukbanner.swift();
						});
					});
				});
			});
		});
		
	}, 
	

	swift: function() {
		$('#uk-banner').empty();
		
		bg = $('<div></div>').hide().addClass('bg-swift');
		el = $("<h1>Services d'accès SWIFT</h1>").hide();
		bg.append(el);
		ex = $('<div></div>').hide().addClass('expander');
		el = $("<h2>Choisissez Bottomline comme votre prestataire de services SWIFT,<br />le partenaire SWIFT le plus accrédité d'Europe</h2>").hide();
		ex.append(el);
		bg.append(ex);
		button = $('<a href="http://www.bottomline.fr/solutions/swift/index.html">Savoir Plus &rarr;</a>').hide();
		bg.append(button);
		
		$('#uk-banner').append(bg);
		
		bg.fadeIn(2000);
		$('#uk-banner h1').fadeIn(2000, function(){
			ex.fadeIn().animate({width: 444, left: '2%'}, 1000).animate({width: 414, left: '4%'}, 800, function(){
				$('h2').fadeIn('slow', function(){
					button.fadeIn('slow', function(){
						bg.delay(4000).fadeOut(2000, function(){
								$ukbanner.documents();
						});
					});
				});
			});
		});
		
	}, 
	
	documents: function() {
		$('#uk-banner').empty();
		
		bg = $('<div></div>').hide().addClass('bg-documents');
		el = $('<h1>Élargissez la portée de votre ERP</h1>').hide();
		bg.append(el);
		ex = $('<div></div>').hide().addClass('expander');
		el = $("<h2>Avec l'automatisation des processus <br />documentaires à l'entrée et à la sortie</h2>").hide();
		ex.append(el);
		bg.append(ex);
		button = $('<a href="http://www.bottomline.fr/solutions/processus_documentaires/index.html">Savoir Plus &rarr;</a>').hide();
		bg.append(button);
		
		$('#uk-banner').append(bg);
		
		bg.fadeIn(2000);
		$('#uk-banner h1').fadeIn(2000, function(){
			ex.fadeIn().animate({width: 280, left: '2%'}, 1000).animate({width: 250, left: '4%'}, 800, function(){
				$('h2').fadeIn('slow', function(){
					button.fadeIn('slow', function(){
						bg.delay(4000).fadeOut(2000, function(){
								$ukbanner.banking();
						});
					});
				});
			});
		});
		
	}, 

	
	banking: function() {
		$('#uk-banner').empty();
		
		bg = $('<div></div>').hide().addClass('bg-banking');
		el = $('<h1>Connecter les banques à leurs clients les plus importants</h1>').hide();
		bg.append(el);
		ex = $('<div></div>').hide().addClass('expander');
		el = $('<h2>Accroître les revenus, fidéliser les clients et augmenter <br />les dépôts grâce à la gestion globale de la trésorerie WebSeries</h2>').hide();
		ex.append(el);
		bg.append(ex);
		button = $('<a href="http://www.bottomline.fr/solutions/services_bancaires/index.html">Savoir Plus &rarr;</a>').hide();
		bg.append(button);
		
		$('#uk-banner').append(bg);
		
		bg.fadeIn(2000);
		$('#uk-banner h1').fadeIn(2000, function(){
			ex.fadeIn().animate({width: 425, left: '2%'}, 1000).animate({width: 395, left: '4%'}, 800, function(){
				$('h2').fadeIn('slow', function(){
					button.fadeIn('slow', function(){
						bg.delay(4000).fadeOut(2000, function(){ $ukbanner.invoicing('swift'); });
					});
				});
			});
		});
	}
	
	
}


