function test_completed(download_speed, upload_speed, latency, server_id, ip)
{
	var curdate 		= new Date(),
		speed 			= document.getElementById('speed'),
		app 			= new App(),
		teaserContainer = $('.teaser-container .teaser-show');
		
	download_rate 	= Math.round((download_speed/8)*10)/10;
	upload_rate 	= Math.round((upload_speed/8)*10)/10;
	$(speed).css({'display':'none'});
	if (speed)
	{
		var string 	= '<h3 class="headline">Last Result:</h3>';
		string += '<div class="downspeed speed-result">';
		string += '		<span class="label">Download Speed:</span><span class="value">' + download_speed + '</span>';
		string += '		<span class="description">kbps (' + download_rate + ' KB/sec transfer rate)</span>';
		string += '		<div class="clear"></div>';
		string += '</div>';
		string += '<div class="upspeed speed-result">';
		string += '		<span class="label">Upload Speed:</span><span class="value">' + upload_speed + '</span>';
		string += '		<span class="description">kbps (' + upload_rate + ' KB/sec transfer rate)</span>';
		string += '		<div class="clear"></div>';
		string += '</div>';
		
		if (latency)
		{
			string += '<div class="latency speed-result">';
			string += '		<span class="label">Latency:</span><span class="value">' + latency + '</span>';
			string += '		<span class="description">ms</span>';
			string += '		<div class="clear"></div>';
			string += '</div>';
		}
		
		string += '<div class="date speed-result">' + curdate.toLocaleString() + '<div class="clear"></div></div>';
		
		string += '<div class="ip speed-result">';
		string += '		<span class="label">IP:</span><span class="value">' + ip + '</span>';
		string += '		<span class="description"></span>';
		string += '		<div class="clear"></div>';
		string += '</div>';
		string += '<div class="clear"></div>';
			
		speed.innerHTML = string;
		$(speed).fadeIn( 500 );
	}
	var abovebefore = document.getElementById('abovebefore');
	if (abovebefore)
	{
		abovebefore.style.display = "none";
	}
	var belowbefore = document.getElementById('belowbefore');
	if (belowbefore)
	{
		belowbefore.style.display = "none";
		
	}
	var aboveafter = document.getElementById('aboveafter');
	if (aboveafter)
	{
		aboveafter.style.display = "block";
	}
	var belowafter = document.getElementById('belowafter');
	teaserContainer.css({'display':'none'}).html('');
	if (belowafter)
	{
		belowafter.style.display = "block";
		
		// teaser anzeigen
		var theIP 		= $('#speed .ip .value').text(),
			downSpeed 	= $('#speed .downspeed .value').text();
			
		app.init(theIP, {speed: downSpeed});
		
		var teaserClass 		= '.teaser-container .teaser-' + app.checkResult(),
			theTeaser 			= $(teaserClass),
			newTeaser 			= theTeaser.clone(),
			teaserHeader		= $('<h2 class="cufon-topic">Ihr passendes Kabel BW Paket</h2>');
			
		newTeaser.addClass('current-product-teaser');
		teaserContainer.append( teaserHeader, newTeaser );
		teaserContainer.fadeIn( 500 );
		Cufon.refresh();
		
		/**
		 * soll tracking code rein
		 * z.B. var track = new Tracker();
		 * 		track.evars({'Products':ProductName}); // ProductName = String
		 *		track.track();		
		 */
	}
}

function test_started(test_count, server_id)
{
	var teststarted = document.getElementById('teststarted');
	if (teststarted)
	{
		teststarted.style.display = "block";
	}
}
