url = location.href;
ordner = '/scopegroup/jscripts/animation/'; // englisch

sequenz = [
				[
					'100.jpg',	// Bild-Url
					'50',  // x
					'140',  // y
					'Mit Ã¼ber 230 Mrd. Euro<br>analysierten VermÃ¶genswerten ...', // Titel deutsch
					'With assets under analysis<br>worth more than 230 billion euros ...', // Titel englisch
					'Activa onder analyse, met een<br>waarde van meer dan 230 miljard ...' // Titel holländisch
				],
				[
					'30.jpg',	// Bild-Url
					'270',  // x
					'60',  // y
					'... ist Scope das derzeit<br>grÃ¶ÃŸte bankenunabhÃ¤ngige<br>Finanzanalyseinstitut<br>Deutschlands.', // Titel deutsch
					'... the Scoup Group is<br>one of the leading<br>analysis providers<br>in Germany.', // Titel englisch
					'... De Scope Groep is<br>een van Duitslands toonaangevende<br>financi&#235;le analyse instituten' // Titel holländisch
				],
				[
					'04.jpg',	// Bild-Url
					'145',  // x
					'80',  // y
					'Mit ihren Dienstleistungen<br>unterstÃ¼tzt die Unternehmensgruppe<br>derzeit Ã¼ber 900 Finanzinstitute ...', // Titel deutsch
					'Scope Analysis currently provides<br>assistance and support to over<br>900 finacial institutions ...', // Titel englisch
					'Momenteel biedt Scope Analysis<br>haar producten en diensten aan<br>meer dan 900 financi&#235;le instanties. ...' // Titel holländisch
				],
				[
					'15.jpg',	// Bild-Url
					'215',  // x
					'85',  // y
					'... bei der Auswahl, der PrÃ¼fung<br>und der Ãœberwachung<br>ihrer Investmentportfolios.', // Titel deutsch
					'... in the selection, review and<br>controlling of their investments', // Titel englisch
					'... Hierbij gaat het met name om investeringselectie,<br>investeringsevaluatie en het monitoren<br>van lopende investeringen.' // Titel holländisch
				],
				[
					'16.jpg',	// Bild-Url
					'315',  // x
					'125',  // y
					'Scope ist auf folgende<br> Assetklassen spezialisiert:', // Titel deutsch
					'Scope specialises in the<br>following asset classes:', // Titel englisch
					'Sope is met name gespecialiseerd<br>in de volgende<br>Asset klasse:' // Titel holländisch
				],
				[
					'13.jpg',	// Bild-Url
					'325',  // x
					'175',  // y
					'Immobilien und <br>Infrastrukturprojekte', // Titel deutsch
					'Real estate and <br>infrastructure projects', // Titel englisch
					'Vastgoed en <br>Infrastructuurprojecten' // Titel holländisch
				],
				[
					'24.jpg',	// Bild-Url
					'180',  // x
					'170',  // y
					'Schiffe, Luftfahrt und<br>andere Transportmittel', // Titel deutsch
					'Ships, aircraft and<br>other means of transportation', // Titel englisch
					'Schepen, luchtvaart<br>en transport' // Titel holländisch
				],
				[
					'28.jpg',	// Bild-Url
					'320',  // x
					'130',  // y
					'Erneuerbare Energien', // Titel deutsch
					'Renewable energies', // Titel englisch
					'Duurzame energie' // Titel holländisch
				],
				[
					'101.jpg',	// Bild-Url
					'200',  // x
					'150',  // y
					'Agrar- und Forstwirtschaft', // Titel deutsch
					'Agriculture and forestry', // Titel englisch
					'Landbouw en bosbouw' // Titel holländisch
				],
				[
					'26.jpg',	// Bild-Url
					'70',  // x
					'120',  // y
					'Private Equity- und<br>Lebensversicherungs-Investment', // Titel deutsch
					'Private equity and life investments', // Titel englisch
					'private equity en<br>life settlement' // Titel holländisch
				],
				[
					'graf.jpg',	// Bild-Url
					'185',  // x
					'220',  // y
					'Indizes und Indexprodukte', // Titel deutsch
					'Indices and index-linked products', // Titel englisch
					'Indexen en indexproducten' // Titel holländisch
				],
				[
					'boerse3.jpg',	// Bild-Url
					'215',  // x
					'42',  // y
					'Derivate und Zertifikate', // Titel deutsch
					'Derivatives and certificates', // Titel englisch
					'Derivaten en certificaten' // Titel holländisch
				],
				[
					'last.jpg',	// Bild-Url
					'215',  // x
					'90',  // y
					'&nbsp;', // Titel deutsch
					'&nbsp;', // Titel englisch
					'&nbsp;' // Titel holländisch
				],
				[
					'100.jpg',	// Bild-Url
					'80',  // x
					'160',  // y
					'Independent Analysis Partner', // Titel deutsch
					'Independent Analysis Partner', // Titel englisch
					'Onafhankelijke analyse partner' // Titel holländisch
				],

		  ];

//checks if value is integer    
function isInt(n){
	var reInt = new RegExp(/^-?\d+$/);
	if (!reInt.test(n)) {
		return false;
	}
	return true;
} 

function startAnimation(i) {
$('#baustein'+i+' img').show();
	$('#baustein'+i).fadeIn(2000, function() {
			

			  $('#baustein'+i+' .title').fadeIn(1000, function(){
								if (i!=(laenge-2)) {
									   var titleWidth = $('#baustein'+i+' .title').css('width').replace(/px/, "");
									   var titleHeight = $('#baustein'+i+' .title').css('height').replace(/px/, "");
									   var left = $('#baustein'+i+' .title').css('left').replace(/px/, "");
									   if (!isInt(titleHeight)) titleHeight=50; // fÃ¼r IE, da hier sonst auto ist
									   if (!isInt(titleWidth)) titleWidth=400; // fÃ¼r IE, da hier sonst auto ist

									   var top = $('#baustein'+i+' .title').css('top').replace(/px/, "");
										left = parseInt(left)+parseInt(titleWidth)/2;
										
								 		top = parseInt(top)+parseInt(titleHeight)/2;
										
										$('.circle').css('width',1);
										$('.circle').css('height',1);
										$('.circle').css('left',left);
										$('.circle').css('top',top);
										//$('.circle').animate({top:top},1);
	

									  if (i!=(laenge-1)) {
	
										   $('.circle').animate({
												width: '1200px',
												height: '1200px', 
												top:	parseInt(top)-600+"px",
												left:	parseInt(left)-600+"px"
											}, 3500);
									   } else { // allerletzte Seite = stoppe Kreis
									   		top = parseInt(top)+80;
									   		$('.circle').css('top',top);
									  		$('.circle').animate({
												width: '500px',
												height: '500px', 
												top:	parseInt(top)-250+"px",
												left:	parseInt(left)-250+"px"
											}, 2500);
									   }
		
									   
										$('.circle').fadeIn(4000, function() {
																	if (i!=(laenge-1)) {
																		if(i!=0) {
																			$('#baustein'+(i-1)).hide(0);
																			$('#baustein'+(i-1)+' img').hide(0);
																			$('#baustein'+(i-1)+' .title').hide(0);	
																		}
																		i++;
																		window.setTimeout('startAnimation('+i+')',2500);
																	} else {
																		$('#restart').fadeIn(4000, function() {});
																	}
										});
								} else {
										// last page Animation
										$('#baustein'+i+' .logo').fadeIn(2000, function() {
												$('#baustein'+i+' .title1').fadeIn(1500, function() {
													$('#baustein'+i+' .title2').fadeIn(1500, function() {
														i++;
														window.setTimeout('startAnimation('+i+')',2500);	
													});					
												});						
											});
								}
							   }
				);
			  }
);}
	
//$(document).ready(function(){
//	 var cache = [];
//	 if (sequenz.length==15) laenge =14;
//	 else laenge =sequenz.length;
//	 
//	 for( var k=0; k<laenge; k++ ) {
//		  var cacheImage = document.createElement('img');
//		  cacheImage.src = ordner+sequenz[k][0];
//		  cache.push(cacheImage);
//		  
//		url = ordner+sequenz[k][0];
//		position = 'left: '+sequenz[k][1]+'px;top: '+sequenz[k][2]+"px";
//		//positionCircle = 'left: '+(parseInt(sequenz[k][1])-100)+'px;top: '+(parseInt(sequenz[k][2])-200)+"px";
//
//		if (language == "en")  title = sequenz[k][4]; // english
//		else if (language == "nl")  title = sequenz[k][5]; // holländisch
//		else title = sequenz[k][3];
//		
//		if (url == ordner+'last.jpg') {
//			$('#flashfilm').append('<div id="baustein'+k+'" class="baustein"><img src="'+url+'"><div class="title" style="'+position+'"><img src="'+ordner+'logo.jpg" class="logo"><span style="display:block;float:left;width:200px;"><img src="'+ordner+'title1.jpg" class="title1"><img src="'+ordner+'title2.jpg" class="title2"></span></div></div>');
//		} else 
//			$('#flashfilm').append('<div id="baustein'+k+'" class="baustein"><img src="'+url+'"><div class="title" style="'+position+'">'+title+'</div></div>');
//	  }
//	  $('#flashfilm').append('<img src="'+ordner+'circle3.png" class="circle"><div id="restart">play again</div>');
//	  startAnimation(0);
//	  
//	  $('#restart').click(function() {
//		$(this).fadeOut(4000);	
//		 for( var k=0; k<laenge; k++ ) {
//			$('#baustein'+k).fadeOut(4000);	
//			$('#baustein'+k+' .title').fadeOut(4000);	
//		 }
//		$('.title1').fadeOut();
//		$('.title2').fadeOut();
//		$('.circle').fadeOut(4000, function(){
//			$('.circle').css('width',1);
//			$('.circle').css('height',1);
//		});
//		$('.logo').fadeOut();	
//		
//		 setTimeout('startAnimation("0")',3000);
//	  });
//
//
//
// });
