
	$(document).ready(function() {
		var url = '';
		var overlay = '';
		if(window.location.href.indexOf('ico-classics') != -1) {
			url = '/extras/splash_generator_classics.php';
			overlay = '/fileadmin/templates/images/ico_classics_overlay.png';
		}
		else {
			url = '/extras/splash_generator.php';
			overlay = '/fileadmin/templates/images/ico_overlay.png';
		}
		jQuery.get(url, '', function(data, textStatus) {
			var ie6 = jQuery.browser.msie && parseInt(jQuery.browser.version) <= 6 ? true : false;
			var overlayhtml = '';
			if(ie6) {
				overlayhtml = '<img style="position: absolute; top: 0px; left: 5px; z-index: 1000;" src="/fileadmin/templates/images/ico_blank.gif" style="filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src=\''+overlay+'\', sizingMethod=\'scale\'); position: absolute; top: 0; left: 0; z-index: 100;"/>';
			}
			else {
				overlayhtml = '<img style="position: absolute; top: 0px; left: 5px; z-index: 1000;" src="'+overlay+'" alt=""/>';
			}
			$('#splash').html(data+'<a href="/">'+overlayhtml+'</a>');
		}, 'html');
		setTimeout(function() {
			$('#splash .splashimg').each(function() {
				if($(this).attr('onclick')) {
					$(this).css('cursor','pointer');
				}
			});
			$('#splash .splashimg:first').css('display','inline');
			var count = 0;
			var prev = 0;
			setInterval(function() {
				$('#splash .splashimg:nth('+count+')').animate({ 'opacity': '0' }, 2000);
				count = count >= ($('#splash .splashimg').length-1) ? 0 : count+1;
				$('#splash .splashimg:nth('+count+')').css({ 'display': 'block', 'opacity': '0', 'z-index': '100' });
				$('#splash .splashimg:nth('+count+')').animate({ 'opacity': '1' }, 2000);
				prev = count - 1;
				if(prev < 0) {
				    prev = $('#splash .splashimg').length-1;
				}
				setTimeout(function() {
					$('#splash .splashimg:nth('+prev+')').css('opacity','0').css('display','none').css('z-index','1');
				}, 2500);
			}, 6000);
		}, 500);
	});
	

