jQuery(document).ready(function ($) {
	$sList = $('#sponsors');
	$sCount = $('>li', $sList).size();
	$sList.hide();
	$($('<div id="sponsorFade"></div>')).insertAfter($sList);
	$c = 0;
	$sDiv = $('#sponsorFade');
	$sDiv.css({
		position: 'relative',
		width: 168,
		height: 128
	});
	$sDiv.css('border','1px solid #000');
	$sDiv.append('<div id="sDetail"></div>');
	$sDetail = $('#sDetail');
	$sDetail.css({
		position: 'absolute',
		width: 160,
		height: 'auto',
		background: 'url(images/descrbg.png)',
		padding: 4,
		left: 0,
		bottom: 0,
		zIndex: 30,
		color: '#FFF'
	});
	// Initialize
	$sDiv.prepend($('<img id="fadeImg2" />').hide());
	$('#fadeImg2').css({
		position: 'absolute',
		top: 0,
		left: 0,
		zIndex: 29,
		width: 168,
		height: 128
	});
	$imgSrc1 = $('>li:eq(' + $c + ') .image img', $sList).attr('src');
	$('#fadeImg2').attr('src', $imgSrc1).fadeIn('slow');
	$sText = $('>li:eq(' + $c + ') .descr', $sList).html();
	$sDetail.empty().html($sText);
	// Lets start the fade slideshow
	var fadeImage = function () {
		$c += 1;
		if ($c > $sCount - 1) {
			$c = 0;
		}
		$('#fadeImg2').fadeOut('slow');
		$('#imgOut').remove();
		$sDiv.prepend($('<img id="fadeImg1" />').hide());
		$img1 = $('#fadeImg1');
		$img1.css({
			position: 'absolute',
			top: 0,
			left: 0,
			zIndex: 29,
			width: 168,
			height: 128
		});
		$imgSrc1 = $('>li:eq(' + $c + ') .image img', $sList).attr('src');
		$img1.attr('src', $imgSrc1).fadeIn('slow');
		$('#fadeImg2').attr('id', 'imgOut');
		$img1.attr('id', 'fadeImg2');
		$sText = $('>li:eq(' + $c + ') .descr', $sList).html();
		$sDetail.empty().html($sText);
	}
	$fadeTimeout = 0;
	$fadeTimeout = setInterval(function () {
		fadeImage()
	}, 2000);
	
	//script for next slider
	$ssList = $('#sponsorsreal');
	$ssCount = $('>li', $ssList).size();
	$ssList.hide();
	$($('<div id="sponsorrealFade"></div>')).insertAfter($ssList);
	$sc = 0;
	$ssDiv = $('#sponsorrealFade');
	$ssDiv.css({
		position: 'relative',
		width: 168,
		height: 128
	});
	$ssDiv.css('border','1px solid #000');
	$ssDiv.append('<div id="ssDetail"></div>');
	$ssDetail = $('#ssDetail');
	$ssDetail.css({
		position: 'absolute',
		width: 0,
		height: 0,
		background: 'url(images/descrbg3.png)',
		padding: 0,
		left: 0,
		bottom: 0,
		zIndex: 30,
		color: '#FFF'
	});
	// Initialize
	$ssDiv.prepend($('<img id="sfadeImg2" />').hide());
	$('#sfadeImg2').css({
		position: 'absolute',
		top: 0,
		left: 0,
		zIndex: 29,
		width: 168,
		height: 128
	});
	$simgSrc1 = $('>li:eq(' + $sc + ') .image33 img', $ssList).attr('src');
	$('#sfadeImg2').attr('src', $simgSrc1).fadeIn('slow');
	$ssText = $('>li:eq(' + $sc + ') .sdescr', $ssList).html();
	$ssDetail.empty().html($ssText);
	// Lets start the fade slideshow
	var fadeImage2 = function () {
		$sc += 1;
		if ($sc > $ssCount - 1) {
			$sc = 0;
		}
		$('#sfadeImg2').fadeOut('slow');
		$('#simgOut').remove();
		$ssDiv.prepend($('<img id="sfadeImg1" />').hide());
		$simg1 = $('#sfadeImg1');
		$simg1.css({
			position: 'absolute',
			top: 0,
			left: 0,
			zIndex: 29,
			width: 168,
			height: 128
		});
		$simgSrc1 = $('>li:eq(' + $sc + ') .image33 img', $ssList).attr('src');
		$simg1.attr('src', $simgSrc1).fadeIn('slow');
		$('#sfadeImg2').attr('id', 'simgOut');
		$simg1.attr('id', 'sfadeImg2');
		$ssText = $('>li:eq(' + $sc + ') .sdescr', $ssList).html();
		$ssDetail.empty().html($ssText);
	}
	$sfadeTimeout = 0;
	$sfadeTimeout = setInterval(function () {
		fadeImage2()
	}, 2000);
});