<?php include ("cookies.php");
	
	// Vertauscht in einem String mit Leerzeichen un 2 Wörtern beide Wörter (Namensausgabe)
	function Vertausch ($string) {
		$leer = strlen($string);
		for ($Zähler = 0; $Zähler < strlen($string); $Zähler++) {
			if (substr($string, $Zähler, 1) == ' '){
				$leer = $Zähler;
				break;
			}
		}
		$eins = substr($string, 0, $leer);
		$zwei = substr($string, $leer+1);
		return $zwei." ".$eins;
	}

// Lese erstmal alle Daten aus der Datenbank aus
include ("Functions_auslesen.php");

if ($NODB_GLOBAL) {
md5($server = 'localhost');
md5($benutzer = 'web127338');
md5($passwort = 'q@Js78eb3cd83n');

//Herstellung der Verbindung zum Server(Namen entsrechend ersetzen)
mysql_connect($server, $benutzer, $passwort) or die ;

//Herstellung der Verbindung zur Datenbank (Namen entsrechend ersetzen)			
mysql_select_db("usr_web127338_1") or die;
}
$row = array();
$row = db_auslesen ();
?>	
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="de" lang="de">
<head>
<?php 
	if ($_GET['Art'] == "F") {
		echo '
		<meta http-equiv="cache-control" content="no-cache">
		<meta http-equiv="cache-control" content="must-revalidate, post-check=0, pre-check=0">
		<meta http-equiv="cache-control" content="private">';
	}

	if (count($row) > 0 and empty($_GET['Sp']) and empty($_GET['Be']) and empty($_GET['Se']) and empty($_GET['Ge']) and count_filter() < 4){
		if ($_GET['Art'] == "Zufall") {
			include ("header3.php");
		}	
		else if ($_GET['Art'] != "Lustig" or $_GET['Tul'] == "Antik" or $_GET['Tul'] == "Zusammenfassung") {
			include ("header.php");
		}
		else if (count_filter() < 2) {
			include ("header.php");
		}	
		else {
			include ("header3.php");
		}
	}	
	else {
		include ("header3.php");
	}
	$colurl = "https://www.ttvideos.de/videos.php?Art=".$_GET['Art'];
	if (!empty($_GET['Na'])) {$colurl = $colurl."&amp;Na=".$_GET['Na'];}
	if (!empty($_GET['Na2'])) {$colurl = $colurl."&amp;Na2=".$_GET['Na2']."&amp;Nam=1";} 
	if (!empty($_GET['Tu'])) {$colurl = $colurl."&amp;Tu=".$_GET['Tu'];}
	if (!empty($_GET['Ja'])) {$colurl = $colurl."&amp;Ja=".$_GET['Ja'];} 
	if (!empty($_GET['Qu'])) {$colurl = $colurl."&amp;Qu=".$_GET['Qu'];}
	if (!empty($_GET['Spe'])) {$colurl = $colurl."&amp;Spe=".$_GET['Spe'];}
	if (!empty($_GET['Be'])) {$colurl = $colurl."&amp;Be=".$_GET['Be'];}
	if (!empty($_GET['Ge'])) {$colurl = $colurl."&amp;Ge=".$_GET['Ge'];}
	if (!empty($_GET['Se'])) {$colurl = $colurl."&amp;Se=".$_GET['Se'];}
	if (!empty($_GET['Tul'])) {$colurl = $colurl."&amp;Tul=".$_GET['Tul'];}
	if (!empty($_GET['Suche'])) {$colurl = $colurl."&amp;Suche=".$_GET['Suche'];}
	if (!empty($_GET['lan'])) {$colurl = $colurl."&amp;lan=".$_GET['lan'];}
	if (!empty($_GET['Lang'])) {$colurl = $colurl."&amp;Lang=1";}
	$vert = false;
?>
	<link rel="canonical" href="<?php echo $colurl; ?>" />
	<meta name="keywords" content="Liste list <?php echo $kwords; ?>"/>
	<meta name="description" content="<?php 
		switch ($_GET['Art']) {
			case "Zufall": if (empty($_GET['Lang'])) {echo "Zufalls Tischtennis Video";} else {echo "Random table tennis video";} break; 
			case "Alle": if (empty($_GET['Lang'])) {echo "Tischtennis Videos";} else {echo "Table tennis videos";} break; 
			case "Neu": if (empty($_GET['Lang'])) {echo "Neueste Tischtennis Videos";} else {echo "New table tennis videos";} break; 
			case "Lustig":				
				if (empty($_GET['Tul'])) {
					if (empty($_GET['Lang'])) {				
						echo "Spezielle Tischtennis Videos";
					} 
					else {
						echo "Special table tennis videos";
					} 
				}				
				else if ($_GET['Tul'] == "Antik") {
					if (empty($_GET['Lang'])) {				
						echo "Antike Tischtennis Videos";
					} 
					else {
						echo "Antique table tennis videos";
					} 
				}
				else if ($_GET['Tul'] == "Compilation") {
					if (empty($_GET['Lang'])) {				
						echo "Tischtennis Videos Compilation";
					} 
					else {
						echo "Table tennis videos compilation";
					} 
				}
				else if ($_GET['Tul'] == "Doku") {
					if (empty($_GET['Lang'])) {				
						echo "Tischtennis Videos Dokumentationen";
					} 
					else {
						echo "Table tennis videos documentation";
					} 
				}
				else if ($_GET['Tul'] == "Lern") {
					if (empty($_GET['Lang'])) {				
						echo "Tischtennis Lern Videos";
					} 
					else {
						echo "Table tennis learning videos";
					} 
				}
				else if ($_GET['Tul'] == "Lustig") {
					if (empty($_GET['Lang'])) {				
						echo "Lustige Tischtennis Videos";
					} 
					else {
						echo "Funny table tennis videos";
					} 
				}
				else if ($_GET['Tul'] == "Show") {
					if (empty($_GET['Lang'])) {				
						echo " Tischtennis Videos Showkampf";
					} 
					else {
						echo "Table tennis videos show match";
					} 
				}
				else if ($_GET['Tul'] == "Training") {
					if (empty($_GET['Lang'])) {				
						echo "Tischtennis Training Videos";
					} 
					else {
						echo "Table tennis training videos";
					} 
				}
				else if ($_GET['Tul'] == "Tribute") {
					if (empty($_GET['Lang'])) {				
						echo "Tribute Tischtennis Videos";
					} 
					else {
						echo "Tribute table tennis videos";
					} 
				}
				else if ($_GET['Tul'] == "Zusammenfassung") {
					if (empty($_GET['Lang'])) {				
						echo "Tischtennis Videos Zusammenfassung";
					} 
					else {
						echo "Table tennis videos summary";
					} 
				}
				else if ($_GET['Tul'] == "Interviews") {
					if (empty($_GET['Lang'])) {
						echo "Interviews mit Tischtennis Spielern";
					} 
					else {
						echo "Interviews with table tennis players";
					} 
				}	
				break;			
			case "F": if (empty($_GET['Lang'])) {echo "Deine Favoriten";} else {echo "Your favorites";} break;
		} 
		if (!empty($_GET['Na'])) {$Na = $_GET['Na']; if ($Na == "SUSS Christian") {$Na = "S&Uuml;SS Christian";} if ($Na == "ROSSKOPF Jorg") {$Na = "ROSSKOPF J&ouml;rg";}
		if (empty($_GET['Lang'])) {echo " mit ";} else {echo " with ";} echo $Na;}
		if (!empty($_GET['Na2'])) {if (empty($_GET['Lang'])) {echo " und mit ".$_GET['Na2'];} else {echo " and with ".$_GET['Na2'];}} 
		if (!empty($_GET['Tu'])) {echo " / ".$_GET['Tu'];}
		if (!empty($_GET['Ja'])) {echo " / ".$_GET['Ja'];} 
		switch ($_GET['Qu']) {
			case "1": if (empty($_GET['Lang'])) {echo " ohne schlechte Qualit&auml;t";} else {echo " without bad image quality";} break; 
			case "2": if (empty($_GET['Lang'])) {echo " in guter und super Qualit&auml;t";} else {echo " in good and super image quality";} break; 
			case "3": if (empty($_GET['Lang'])) {echo " in super Qualit&auml;t";} else {echo " in super image quality";} break;
			default:break;
		}	
		switch ($_GET['Spe']) {
			case "1": if (empty($_GET['Lang'])) {echo " (Ganze Matches)";} else {echo " (Full Matches)";} break; 
			case "3": if (empty($_GET['Lang'])) {echo " (Ganze Matches - kurz)";} else {echo " (Full Matches - short)";} break; 
			case "2": echo " (Highlights)"; break;
			default:break;
		}	
		if (empty($_GET['Lang'])) {echo " auf TTvideos.de - DIE Tischtennis Video Plattform mit umfangreicher Datenbank (".Vertausch($Na)." ".Vertausch($_GET['Na2']).")";} else {echo " on TTvideos.de - THE table tennis movie portal with a large database (".Vertausch($Na)." ".Vertausch($_GET['Na2']).")";}?>"/>
	<title><?php 
		switch ($_GET['Art']) {
			case "Zufall": if (empty($_GET['Lang'])) {echo "Zufalls Tischtennis Video";} else {echo "Random table tennis video";} break; 
			case "Alle": if (empty($_GET['Lang'])) {echo "Tischtennis Videos";} else {echo "Table tennis videos";} break;
			case "Neu": if (empty($_GET['Lang'])) {echo "Neueste Tischtennis Videos";} else {echo "New table tennis videos";} break; 
			case "Lustig": 
				$vert = true;
				if (empty($_GET['Tul'])) {
					if (empty($_GET['Lang'])) {				
						echo "Spezielle Tischtennis Videos";
					} 
					else {
						echo "Special table tennis videos";
					} 
				}				
				else if ($_GET['Tul'] == "Antik") {
					if (empty($_GET['Lang'])) {				
						echo "Antike Tischtennis Videos";
					} 
					else {
						echo "Antique table tennis videos";
					} 
				}
				else if ($_GET['Tul'] == "Compilation") {
					if (empty($_GET['Lang'])) {				
						echo "Tischtennis Videos Compilation";
					} 
					else {
						echo "Table tennis videos compilation";
					} 
				}
				else if ($_GET['Tul'] == "Doku") {
					if (empty($_GET['Lang'])) {				
						echo "Tischtennis Videos Dokumentationen";
					} 
					else {
						echo "Table tennis videos documentation";
					} 
				}
				else if ($_GET['Tul'] == "Lern") {
					if (empty($_GET['Lang'])) {				
						echo "Tischtennis Lern Videos";
					} 
					else {
						echo "Table tennis learning videos";
					} 
				}
				else if ($_GET['Tul'] == "Lustig") {
					if (empty($_GET['Lang'])) {				
						echo "Lustige Tischtennis Videos";
					} 
					else {
						echo "Funny table tennis videos";
					} 
				}
				else if ($_GET['Tul'] == "Show") {
					if (empty($_GET['Lang'])) {				
						echo " Tischtennis Videos Showkampf";
					} 
					else {
						echo "Table tennis videos show match";
					} 
				}
				else if ($_GET['Tul'] == "Training") {
					if (empty($_GET['Lang'])) {				
						echo "Tischtennis Training Videos";
					} 
					else {
						echo "Table tennis training videos";
					} 
				}
				else if ($_GET['Tul'] == "Tribute") {
					if (empty($_GET['Lang'])) {				
						echo "Tribute Tischtennis Videos";
					} 
					else {
						echo "Tribute table tennis videos";
					} 
				}
				else if ($_GET['Tul'] == "Zusammenfassung") {
					if (empty($_GET['Lang'])) {				
						echo "Tischtennis Videos Zusammenfassung";
					} 
					else {
						echo "Table tennis videos summary";
					} 
				}
				else if ($_GET['Tul'] == "Interviews") {
					if (empty($_GET['Lang'])) {
						echo "Interviews mit Tischtennis Spielern";
					} 
					else {
						echo "Interviews with table tennis players";
					} 	
				}
				break;
			case "F": if (empty($_GET['Lang'])) {echo "Deine Favoriten";} else {echo "Your favorites";} break;
		} 
		if (!empty($_GET['Na'])) {echo "/"; if ($vert) {echo Vertausch($_GET['Na']);} else {echo $_GET['Na'];}}
		if (!empty($_GET['Na2'])) {echo "/".$_GET['Na2'];} 
		if (!empty($_GET['Tu'])) {echo "/".$_GET['Tu'];} 
		if (!empty($_GET['Ja'])) {echo "/".$_GET['Ja'];} 
		switch ($_GET['Qu']) {
			case "1": if (empty($_GET['Lang'])) {echo "/normale Quali";} else {echo "/normal quali";} break; 
			case "2": if (empty($_GET['Lang'])) {echo "/gute und super Quali";} else {echo "/good and super quali";} break; 
			case "3": if (empty($_GET['Lang'])) {echo "/super Quali";} else {echo "/super quali";} break;
		}
		switch ($_GET['Spe']) {
			case "1": if (empty($_GET['Lang'])) {echo "/Ganze Matches";} else {echo "/Full Matches";} break; 
			case "3": if (empty($_GET['Lang'])) {echo "/Ganze Matches-kurz";} else {echo "/Full Matches-short";} break; 
			case "2": echo "/Highlights"; break;
		}
		if (!empty($_GET['Suche'])) {echo "/".$_GET['Suche'];} ?> - TTvideos.de
	</title>	
</head>
<body <?php Farbe_bild(); ?>>
<div class="overall">

<?php include ("Menu.php"); include ("hilf.php");	
?>	
	<div class="Werbung_Mitte Schwarz" align="center">
<?php	
		if (!empty($_GET['Tu']) and $_GET['Tu'] == 'Champions League') {
			echo '
			<div class="border_thin w100pro">
				<h3>Laola Champions League Player</h3>
				<iframe name="laol1tvplayer" id="laola1tvplayer"src="http://www.laola1.tv/partner/v4player/index.php?identifier=ttvideos" border="0"marginheight="0" marginwidth="0" allowtransparency="true" overflow="hidden"frameborder="0" height="488" scrolling="no" width="500"></iframe>
			</div>';
		}
						
		if (!empty($_GET['Na'])) {
?>			
			<div class="Spielerinfos backfarbe2 schatten" align="center">
				<?php Informationen ($Name_menu, $AlleSpieler); 
				$rangl = Ranglisten_suche($Name_menu);
				if ($rangl != "-") {
					if ($rangl > 10) {$ran = $rangl-10;} else {$ran = "oben";}
					if ($rangl > 400) {
						$zusatz = "&amp;site=5";
					}
					else if ($rangl > 300) {
						$zusatz = "&amp;site=4";
					}
					else if ($rangl > 200) {
						$zusatz = "&amp;site=3";
					}
					else if ($rangl > 100) {
						$zusatz = "&amp;site=2";
					}
					else {
						$zusatz = "";
					}
					
					if ($dam) {
						echo "<a class='".$menu."' href='Weltrangliste.php".Url_erstellen("Art", "W")."&amp;Welt=w".$zusatz."#s".$ran."'>";
					}
					else {
						echo "<a class='".$menu."' href='Weltrangliste.php".Url_erstellen("Art", "W").$zusatz."#s".$ran."'>";
					}
					
					Sprache (" ---- <i>(Aktueller Weltranglistenplatz: ", " ---- <i>(Current World-Ranking: "); echo $rangl; echo ")</i>";
					echo "</a>";
				}
				else {
					Sprache (" ---- <i>(Aktueller Weltranglistenplatz: ", " ---- <i>(Current World-Ranking: "); echo $rangl; echo ")</i>"; 
				} ?>
			</div>
			<br/>
<?php 
		}
		
		
		if ($_GET['Art'] != "Zufall") {
			
			// Falls nicht spezielle Videos ausgewählt werden Berechnungen gestartet
			if ($_GET['Art'] != "Neu" and $_GET['Art'] == "Alle") {
				if (1 == 1) {
				}
				else if ($_COOKIE['Color'] != "3") {
?>			
					<script type="text/javascript"><!--
						google_ad_client = "ca-pub-4142467347337183";
						/* Videosuche grau */
						google_ad_slot = "8859406272";
						google_ad_width = 468;
						google_ad_height = 60;
						//-->
					</script>
					<script type="text/javascript"
						src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
					</script>
<?php
				}
				else {
?>				
					<script type="text/javascript"><!--
						google_ad_client = "ca-pub-4142467347337183";
						/* Videosuche */
						google_ad_slot = "9134296856";
						google_ad_width = 468;
						google_ad_height = 60;
						//-->
					</script>
					<script type="text/javascript"
						src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
					</script>
<?php
				}			
				
				echo "<br/><br/>";
				
				Sprache ("<b>Jahre/Spieler/Turniere in Verbindung mit den Filtereinstellungen:</b><br/><br/>", 
				"<b>Years/players/tournaments combined with the filter options:</b><br/><br/>");
				// Hole alle entprchenden Videos aus Datenbank

				if (empty($_GET['Up'])) {
					$Up = "0";
				}
				else {
					$Up = $_GET['Up'];
				}
				if (empty($_GET['Tu'])) {
					$Tu = 0;
				}
				else {
					$Tu = $_GET['Tu'];
				}
				$Tul = 0;
				if (empty($_GET['Na'])) {
					$name = 0;
				}
				else {
					$name = $_GET['Na'];
				}
				if (empty($_GET['Na2'])) {
					$Na2 = 0;
				}
				else {
					$Na2 = $_GET['Na2'];
				}

				if (empty($_GET['Ja'])) {
					$Ja = 0;
				}
				else {
					$Ja = $_GET['Ja'];
				}
				if (empty($_GET['Qu'])) {
					$Qu = -1;
				}
				else {
					$Qu = $_GET['Qu'];
				}
				if (empty($_GET['Be'])) {
					$Be = 0;
				}
				else {
					$Be = $_GET['Be'];
				}
				if (empty($_GET['Spe'])) {
					$Spe = 0;
				}
				else {
					$Spe = $_GET['Spe'];
				}
				if (empty($_GET['Ge'])) {
					$Ge = 0;
					$U21 = 0;
					$U21b = 1;
				}
				else {
					if ($_GET['Ge'] == "U21") {
						$Ge = 0;
						$U21b = 1;
						$U21 = 1;
					}
					else {
						$Ge = $_GET['Ge'];
						$U21 = 0;
						$U21b = 0;
					}	
				}
				
				// Ausgabe der Ergebnisse (JAHRE)
				echo '<div class="border_thin w100pro"><h3 class="show">';
					Sprache ("W&auml;hle Jahr", "Choose year");
					echo "</h3>";
					if (!empty($Ja)) {
						echo "<br/><a class='".$menu."' href='videos.php?Art=".$_GET['Art']."&amp;Ja=".$Ja;
						Sprache ("'> (Alle Videos von <h4 class='show'>".$Ja."</h4> anzeigen", "&amp;Lang=1'> (Show all videos from <h4 class='show'>".$Ja."</h4>");
						echo ")</a>";
					}
					echo "<br/>";
				
				// Wenn kein Filter angewählt kein auslesen aus DB, sindern Standarschleife
				if (Filter_leer3()) {
					$hilfcounter = 0;
					for ($i=$jahr_aktuellmenu; $i > 1976; $i--) {
						
						if ($hilfcounter%10 == 0) {
							echo "<br/>";
						}
						else {
							echo " --- ";
						}
						$hilf = $alle2[$i];
						echo "<a class='Un-menu Schwarz' href='videos.php".Url_erstellen("Ja", "$i")."'>".$i."</a>";
						$hilfcounter++;
					}
				}
				
				else {
				
					// ALLE JAHRE AUSGEBEN 				
					// Filtereinstellungen checken				
					$ergebnis2 = mysql_query("SELECT Jahr FROM video WHERE
					(test1 = '$name' OR Name_ID1 = '$name' OR Name_ID2 = '$name' OR Name_ID3 = '$name' OR Name_ID4 = '$name') AND 
					(test1 = '$Na2' OR Name_ID1 = '$Na2' OR Name_ID2 = '$Na2' OR Name_ID3 = '$Na2' OR Name_ID4 = '$Na2') AND 
					(test = $Ge OR Geschlecht = $Ge OR Geschlecht = $Ge-1 OR Geschlecht = $Ge-20 OR Geschlecht = $Ge-2 OR Geschlecht = $Ge-4 OR Geschlecht = $Ge+4) AND
					(test1 = '$Tu' OR Turnier = '$Tu') AND
					(test1 = '$Up' OR Uploader = '$Up') AND
					(Quali >= $Qu AND Quali != '9') AND
					(U21 = $U21 OR U21 = $U21b) AND
					(test = $Spe OR FULL_MATCH = $Spe) AND
					(Bewertungsdurchschnitt >= $Be) ORDER BY Jahr DESC");			
			
					$Zähler = 0;
					$noausgabe = true;
					while($row2[$Zähler] = mysql_fetch_object($ergebnis2)) {					
						$Zähler++;	
					}
					$Zähler = count($row2) - 1;
					unset ($row2[$Zähler]);	
					
					// Suche alle Jahre raus, mit Anzahl der verfügbaren Videos
					$alle_count2 = array ();
					$alle2 = array ();
					$Zähler = -1;
					for ($i=0; $i < count($row2); $i++) {
						$jahr = $row2[$i]->Jahr;				
						if (!empty($jahr) and $jahr != $Ja) {			
							if (!in_array($jahr, $alle2)) {
								$Zähler++;
								$alle2[$Zähler] = $jahr;
								$alle_count2[$jahr] = 1;
							}
							else {
								$alle_count2[$jahr] = $alle_count2[$jahr] + 1;
							}
						}
					}

					for ($i=0; $i < count($alle2); $i++) {
						if ($i%5 == 0) {
							echo "<br/>";
						}
						else {
							echo " --- ";
						}
						$hilf = $alle2[$i];
						echo "<a class='Un-menu Schwarz' href='videos.php".Url_erstellen("Ja", "$hilf")."'>".$hilf." <span class='Schwarz'>(".$alle_count2[$hilf].")</span></a>";
					}
				}
				echo '<br/><br/></div>';
				
				echo "<table width='100%' cellpadding='5' cellspacing='5' border='1' rules='cols'><tr><td valign='top' width='60%'>";
				
				// Wenn 2 Spieler auswählen, gewählt gib hier alle Spieler aus mit denen Videos in der Datenbank existieren
				if (!empty($_GET['Na']) and empty($_GET['lan'])) {
		
					// Filtereinstellungen checken
					$ergebnis = mysql_query("SELECT Name_ID1, Name_ID2, Name_ID3, Name_ID4 FROM video WHERE
					(test1 = '$name' OR Name_ID1 = '$name' OR Name_ID2 = '$name' OR Name_ID3 = '$name' OR Name_ID4 = '$name') AND 
					(test = $Ge OR Geschlecht = $Ge OR Geschlecht = $Ge-1 OR Geschlecht = $Ge-20 OR Geschlecht = $Ge-2 OR Geschlecht = $Ge-4 OR Geschlecht = $Ge+4) AND
					(Quali >= $Qu AND Quali != '9') AND
					(test1 = '$Up' OR Uploader = '$Up') AND
					(U21 = $U21 OR U21 = $U21b) AND
					(test1 = '$Tu' OR Turnier = '$Tu') AND
					(test = $Ja OR Jahr = $Ja) AND
					(test = $Spe OR FULL_MATCH = $Spe) AND
					(Bewertungsdurchschnitt >= $Be) ORDER BY Jahr DESC");
					
					$Zähler = 0;
					while($row[$Zähler] = mysql_fetch_object($ergebnis)) {													
						$Zähler++;
					}
					$Zähler = count($row) - 1;
					unset ($row[$Zähler]);
					
					// Suche alle Gegner raus, mit Anzahl der verfügbaren Spielern
					$alle_count = array ();
					$alle = array ();
					$Zähler = -1;
					for ($i=0; $i < count($row); $i++) {
						$na1 = $row[$i]->Name_ID1;
						$na2 = $row[$i]->Name_ID2;
						$na3 = $row[$i]->Name_ID3;
						$na4 = $row[$i]->Name_ID4;					
						if (!empty($na1) and $na1 != $name) {			
							if (!in_array($na1, $alle)) {
								$Zähler++;
								$alle[$Zähler] = $na1;
								$alle_count[$na1] = 1;
							}
							else {
								$alle_count[$na1] = $alle_count[$na1] + 1;
							}
						}
						if (!empty($na2) and $na2 != $name) {
							if (!in_array($na2, $alle)) {
								$Zähler++;
								$alle[$Zähler] = $na2;
								$alle_count[$na2] = 1;
							}
							else {
								$alle_count[$na2] = $alle_count[$na2] + 1;
							}
						}
						if (!empty($na3) and $na3 != $name) {
							if (!in_array($na3, $alle)) {
								$Zähler++;
								$alle[$Zähler] = $na3;
								$alle_count[$na3] = 1;
							}
							else {
								$alle_count[$na3] = $alle_count[$na3] + 1;
							}
						}
						if (!empty($na4) and $na4 != $name) {
							if (!in_array($na4, $alle)) {
								$Zähler++;
								$alle[$Zähler] = $na4;
								$alle_count[$na4] = 1;
							}
							else {
								$alle_count[$na4] = $alle_count[$na4] + 1;
							}
						}
					}
					
					// sortiere ALLE arrays alphabetisch
					$tausch = true;
					for ($k=count($alle)-1; $k > 0 and $tausch; $k--) {
						$tausch = false;
						for ($j=0; $j < $k; $j++) {
							$eins = strtoupper($alle[$j][0]);
							$zwei = strtoupper($alle[$j+1][0]);
							$counter = 0;
							if ($alle[$j] != $alle[$j+1]) {
								while ($zwei == $eins) {
									$counter++;
									$eins = strtoupper($alle[$j][$counter]);
									$zwei = strtoupper($alle[$j+1][$counter]);
								}
							}
							if ($eins > $zwei) {
								$temp = $alle[$j];
								$alle[$j] = $alle[$j+1];
								$alle[$j+1] = $temp;
							
								$temp = $alle_count[$j];
								$alle_count[$j] = $alle_count[$j+1];
								$alle_count[$j+1] = $temp;
								$tausch = true;
							}
						}
					}

					// Ausgabe der Ergebnisse (2. SPIELER)
					echo '<div align="center"><h3 class="show">';
					Sprache ("W&auml;hle zweiten Spieler", "Choose second player");
					echo "</h3>";
					if (!empty($name)) {
						echo "<br/><a class='".$menu."' href='videos.php?Art=".$_GET['Art']."&amp;Na=".$name;
						Sprache ("'> (Alle Videos von <h4 class='show'>".$name."</h4> anzeigen", "&amp;Lang=1'> (Show all videos from <h4 class='show'>".$name."</h4>");
						echo ")</a>";
					}
					
					echo "</div><br/><table class='backfarbe' border='1' width='100%' rules='rows'><tr><td>";
					$quo = count($alle)/2 + 1;
					for ($i=0; $i < count($alle); $i++) {
						if ($i%$quo == 0 and $i != 0) {
						echo "</td><td>";
						}
						$hilf = $alle[$i];
						echo "<a class='".$menu." ".$Schwarz."' href='videos.php".Url_erstellen("Na2", "$hilf")."&amp;Nam=1'>".$hilf." (".$alle_count[$hilf].")</a><br/>";
					}
					echo "</td></tr></table><br/>";
					
					echo "<div class='h50'><a class='Live_link w180' href='videos.php".Url_erstellen("lan", "1")."'><b>&nbsp;&nbsp;";
					Sprache ("Einen Spieler ausw&auml;hlen", "Choose one player");
					echo "&nbsp;&nbsp;</b></a></div><br/><br/>";
				}
				
				// Hier werden alle Spieler ausgeben, mit denen Videos, anch Filterprüfung in der Datenbank existieren (Spieler-Filtereinstellung Na und Na2 wird ignoriert)
				else {
					
					// Wenn Filter nicht leer ist wird Berechnung gestartet
					$noausgabe = false;
					$fleer = false;
					if (Filter_leer2()) {
						$fleer = true;
					}
					else {
						$ergebnis4 = mysql_query("SELECT Name_ID1, Name_ID2, Name_ID3, Name_ID4  FROM video WHERE
						(test = $Ge OR Geschlecht = $Ge OR Geschlecht = $Ge-1 OR Geschlecht = $Ge-20 OR Geschlecht = $Ge-2 OR Geschlecht = $Ge-4 OR Geschlecht = $Ge+4) AND
						(Quali >= $Qu AND Quali != '9') AND
						(U21 = $U21 OR U21 = $U21b) AND
						(test1 = '$Up' OR Uploader = '$Up') AND
						(test1 = '$Tu' OR Turnier = '$Tu') AND
						(test = $Ja OR Jahr = $Ja) AND
						(test = $Spe OR FULL_MATCH = $Spe) AND
						(Bewertungsdurchschnitt >= $Be) ORDER BY Jahr DESC");
						
						$Zähler = 0;
						$noausgabe = true;
						while($row4[$Zähler] = mysql_fetch_object($ergebnis4)) {					
							$Zähler++;
						}
						$Zähler = count($row4) - 1;
						unset ($row4[$Zähler]);	
					
						// Ausgabe nur, falls nicht zuviele Videos gefunden wurden
						if ($noausgabe) {
							// Suche alle Gegner raus, mit Anzahl der verfügbaren Spielern
							$alle_count4 = array ();
							$alle4 = array ();
							$Zähler = -1;
							for ($i=0; $i < count($row4); $i++) {
								$na1 = $row4[$i]->Name_ID1;
								$na2 = $row4[$i]->Name_ID2;
								$na3 = $row4[$i]->Name_ID3;
								$na4 = $row4[$i]->Name_ID4;					
								if (!empty($na1)) {			
									if (!in_array($na1, $alle4)) {
										$Zähler++;
										$alle4[$Zähler] = $na1;
										$alle_count4[$na1] = 1;
									}
									else {
										$alle_count4[$na1] = $alle_count4[$na1] + 1;
									}
								}
								if (!empty($na2)) {
									if (!in_array($na2, $alle4)) {
										$Zähler++;
										$alle4[$Zähler] = $na2;
										$alle_count4[$na2] = 1;
									}
									else {
										$alle_count4[$na2] = $alle_count4[$na2] + 1;
									}
								}
								if (!empty($na3)) {
									if (!in_array($na3, $alle4)) {
										$Zähler++;
										$alle4[$Zähler] = $na3;
										$alle_count4[$na3] = 1;
									}
									else {
										$alle_count4[$na3] = $alle_count4[$na3] + 1;
									}
								}
								if (!empty($na4)) {
									if (!in_array($na4, $alle4)) {
										$Zähler++;
										$alle4[$Zähler] = $na4;
										$alle_count4[$na4] = 1;
									}
									else {
										$alle_count4[$na4] = $alle_count4[$na4] + 1;
									}
								}										
							}
							
							// Falls zuviele Spieler gefunden, mache zwar Berechnugn für später fertig, aber gehe in den "Standard"-Asuageb Modus
							if (count($alle4) > 40) {
								$noausgabe = false;
							}

							if ($noausgabe) {
								// sortiere ALLE arrays alphabetisch
								$tausch = true;
								for ($k=count($alle4)-1; $k > 0 and $tausch; $k--) {
									$tausch = false;
									for ($j=0; $j < $k; $j++) {
										$eins = strtoupper($alle4[$j][0]);
										$zwei = strtoupper($alle4[$j+1][0]);
										$counter = 0;
										if ($alle4[$j] != $alle4[$j+1] and $_GET['Tu'] != "Asian Championships (Team)") {
											while ($zwei == $eins) {
												$counter++;
												$eins = strtoupper($alle4[$j][$counter]);
												$zwei = strtoupper($alle4[$j+1][$counter]);
											}
										}
										if ($eins > $zwei) {
											$temp = $alle4[$j];
											$alle4[$j] = $alle4[$j+1];
											$alle4[$j+1] = $temp;
										
											$temp = $alle_count4[$j];
											$alle_count4[$j] = $alle_count4[$j+1];
											$alle_count4[$j+1] = $temp;
											$tausch = true;
										}
									}
								}

								// Ausgabe der Ergebnisse (Spieler)
								echo '<div align="center"><h3 class="show">';
								Sprache ("W&auml;hle Spieler", "Choose player");
								echo "</h3>";
								if (!empty($name)) {
									echo "<br/><a class='".$menu."' href='videos.php?Art=".$_GET['Art']."&amp;Na=".$name;
									Sprache ("'> (Alle Videos von <h4 class='show'>".$name."</h4> anzeigen", "&amp;Lang=1'> (Show all videos from <h4 class='show'>".$name."</h4>");
									echo ")</a>";
								}
								
								echo "</div><br/><table class='backfarbe' border='1' width='100%' rules='rows'><tr><td>";
								$quo = count($alle4)/2 + 1;
								for ($i=0; $i < count($alle4); $i++) {
									if ($i%$quo == 0 and $i != 0) {
									echo "</td><td>";
									}
									$hilf = $alle4[$i];
									echo "<a class='".$menu." ".$Schwarz."' href='videos.php".Url_erstellen("Na", "$hilf")."&amp;Na2=0&amp;Nam=0'>".$hilf." (".$alle_count4[$hilf].")</a><br/>";
								}
								echo "</td></tr></table><br/>";
							
								if (!empty($name)) {
									echo "<div class='h50'><a class='Live_link w180' href='videos.php".Url_erstellen("lan", "0")."'><b>&nbsp;&nbsp;";
									Sprache ("Zweiten Spieler w&auml;hlen", "Choose second player");
									echo "&nbsp;&nbsp;</b></a></div><br/><br/>";
								}
							}
						}						
					}
					
					if ($fleer) {
						if (!empty($_GET['Lang'])) {
?>				
							<div align="center"><h3 class='show'>Choose player</h3>
<?php	
							$name = $_GET['Na'];
							if (!empty($name)) {
								echo "<br/><a class='".$menu."' href='videos.php?Art=".$_GET['Art']."&amp;Na=".$name."&amp;Lang=1&amp;V=".$_GET['V']."'> (Show all videos from <h4 class='show'>".$name."</h4>)</a>";
							}
?>						
							</div><br/>
							<a class="Up <?php echo $menu." ".$Schwarz; ?>" href="videos.php<?php echo Url_erstellen("la", "australien"); ?>&amp;lan=1">Australia</a> - 
							<a class="Up <?php echo $menu." ".$Schwarz; ?>" href="videos.php<?php echo Url_erstellen("la", "argentinien"); ?>&amp;lan=1">Argentina</a> - 
							<a class="Up <?php echo $menu." ".$Schwarz; ?>" href="videos.php<?php echo Url_erstellen("la", "österreich"); ?>&amp;lan=1">Austria</a> - 
							<a class="Up <?php echo $menu." ".$Schwarz; ?>" href="videos.php<?php echo Url_erstellen("la", "weissrussland"); ?>&amp;lan=1">Belarus</a> - 
							<a class="Up <?php echo $menu." ".$Schwarz; ?>" href="videos.php<?php echo Url_erstellen("la", "belgien"); ?>&amp;lan=1">Belgium</a> - 
							<a class="Up <?php echo $menu." ".$Schwarz; ?>" href="videos.php<?php echo Url_erstellen("la", "brasilien"); ?>&amp;lan=1">Brazil</a> - 
							<a class="Up <?php echo $menu." ".$Schwarz; ?>" href="videos.php<?php echo Url_erstellen("la", "china"); ?>&amp;lan=1">China</a> - 
							<a class="Up <?php echo $menu." ".$Schwarz; ?>" href="videos.php<?php echo Url_erstellen("la", "kroatien"); ?>&amp;lan=1">Croatia</a> - 
							<a class="Up <?php echo $menu." ".$Schwarz; ?>" href="videos.php<?php echo Url_erstellen("la", "tschechische"); ?>&amp;lan=1">Czech Republic</a> - 
							<a class="Up <?php echo $menu." ".$Schwarz; ?>" href="videos.php<?php echo Url_erstellen("la", "dänemark"); ?>&amp;lan=1">Denmark</a> - 
							<a class="Up <?php echo $menu." ".$Schwarz; ?>" href="videos.php<?php echo Url_erstellen("la", "dominikanischerepublic"); ?>&amp;lan=1">Dominican Republic</a> - 
							<a class="Up <?php echo $menu." ".$Schwarz; ?>" href="videos.php<?php echo Url_erstellen("la", "england"); ?>&amp;lan=1">England</a> - 
							<a class="Up <?php echo $menu." ".$Schwarz; ?>" href="videos.php<?php echo Url_erstellen("la", "frankreich"); ?>&amp;lan=1">France</a> - 
							<a class="Up <?php echo $menu." ".$Schwarz; ?>" href="videos.php<?php echo Url_erstellen("la", "deutschland"); ?>&amp;lan=1">Germany</a> - 
							<a class="Up <?php echo $menu." ".$Schwarz; ?>" href="videos.php<?php echo Url_erstellen("la", "griechenland"); ?>&amp;lan=1">Greece</a> - 
							<a class="Up <?php echo $menu." ".$Schwarz; ?>" href="videos.php<?php echo Url_erstellen("la", "hongkong"); ?>&amp;lan=1">Hong Kong</a> - 
							<a class="Up <?php echo $menu." ".$Schwarz; ?>" href="videos.php<?php echo Url_erstellen("la", "ungarn"); ?>&amp;lan=1">Hungary</a> - 
							<a class="Up <?php echo $menu." ".$Schwarz; ?>" href="videos.php<?php echo Url_erstellen("la", "indien"); ?>&amp;lan=1">India</a> -					
							<a class="Up <?php echo $menu." ".$Schwarz; ?>" href="videos.php<?php echo Url_erstellen("la", "italien"); ?>&amp;lan=1">Italy</a> - 
							<a class="Up <?php echo $menu." ".$Schwarz; ?>" href="videos.php<?php echo Url_erstellen("la", "japan"); ?>&amp;lan=1">Japan</a> - 
							<a class="Up <?php echo $menu." ".$Schwarz; ?>" href="videos.php<?php echo Url_erstellen("la", "litauen"); ?>&amp;lan=1">Lithuania</a> - 
							<a class="Up <?php echo $menu." ".$Schwarz; ?>" href="videos.php<?php echo Url_erstellen("la", "luxemburg"); ?>&amp;lan=1">Luxembourg</a> - 
							<a class="Up <?php echo $menu." ".$Schwarz; ?>" href="videos.php<?php echo Url_erstellen("la", "niederlande"); ?>&amp;lan=1">Netherlands</a> - 
							<a class="Up <?php echo $menu." ".$Schwarz; ?>" href="videos.php<?php echo Url_erstellen("la", "nordkorea"); ?>&amp;lan=1">North Korea</a> - 
							<a class="Up <?php echo $menu." ".$Schwarz; ?>" href="videos.php<?php echo Url_erstellen("la", "polen"); ?>&amp;lan=1">Poland</a> - 
							<a class="Up <?php echo $menu." ".$Schwarz; ?>" href="videos.php<?php echo Url_erstellen("la", "portugal"); ?>&amp;lan=1">Portugal</a> - 
							<a class="Up <?php echo $menu." ".$Schwarz; ?>" href="videos.php<?php echo Url_erstellen("la", "rumänien"); ?>&amp;lan=1">Romania</a> - 
							<a class="Up <?php echo $menu." ".$Schwarz; ?>" href="videos.php<?php echo Url_erstellen("la", "russland"); ?>&amp;lan=1">Russia</a> - 
							<a class="Up <?php echo $menu." ".$Schwarz; ?>" href="videos.php<?php echo Url_erstellen("la", "schweden"); ?>&amp;lan=1">Sweden</a> - 
							<a class="Up <?php echo $menu." ".$Schwarz; ?>" href="videos.php<?php echo Url_erstellen("la", "serbien"); ?>&amp;lan=1">Serbia</a> - 
							<a class="Up <?php echo $menu." ".$Schwarz; ?>" href="videos.php<?php echo Url_erstellen("la", "singapur"); ?>&amp;lan=1">Singapore</a> - 
							<a class="Up <?php echo $menu." ".$Schwarz; ?>" href="videos.php<?php echo Url_erstellen("la", "slowakei"); ?>&amp;lan=1">Slovakia</a> - 
							<a class="Up <?php echo $menu." ".$Schwarz; ?>" href="videos.php<?php echo Url_erstellen("la", "slowenien"); ?>&amp;lan=1">Slowenia</a> - 
							<a class="Up <?php echo $menu." ".$Schwarz; ?>" href="videos.php<?php echo Url_erstellen("la", "spanien"); ?>&amp;lan=1">Spain</a> - 
							<a class="Up <?php echo $menu." ".$Schwarz; ?>" href="videos.php<?php echo Url_erstellen("la", "korea"); ?>&amp;lan=1">South Korea</a> - 
							<a class="Up <?php echo $menu." ".$Schwarz; ?>" href="videos.php<?php echo Url_erstellen("la", "taiwan"); ?>&amp;lan=1">Taiwan</a> - 
							<a class="Up <?php echo $menu." ".$Schwarz; ?>" href="videos.php<?php echo Url_erstellen("la", "türkei"); ?>&amp;lan=1">Turkey</a> - 
							<a class="Up <?php echo $menu." ".$Schwarz; ?>" href="videos.php<?php echo Url_erstellen("la", "ukraine"); ?>&amp;lan=1">Ukraine</a> - 
							<a class="Up <?php echo $menu." ".$Schwarz; ?>" href="videos.php<?php echo Url_erstellen("la", "USA"); ?>&amp;lan=1">USA</a><br/><br/>
<?php
						}
						else {
?>
							<div align="center"><h3 class='show'>W&auml;hle Spieler</h3>
<?php	
							$name = $_GET['Na'];
							if (!empty($name)) {							
								echo "<br/><a class='".$menu."' href='videos.php?Art=".$_GET['Art']."&amp;Na=".$name."&amp;V=".$_GET['V']."'> (Alle Videos von <h4 class='show'>".$name."</h4> anzeigen)</a>";
							}
?>						
							</div><br/>
							<a class="Up <?php echo $menu." ".$Schwarz; ?>" href="videos.php<?php echo Url_erstellen("la", "australien"); ?>&amp;lan=1">Australien</a> - 
							<a class="Up <?php echo $menu." ".$Schwarz; ?>" href="videos.php<?php echo Url_erstellen("la", "argentinien"); ?>&amp;lan=1">Argentinien</a> - 
							<a class="Up <?php echo $menu." ".$Schwarz; ?>" href="videos.php<?php echo Url_erstellen("la", "belgien"); ?>&amp;lan=1">Belgien</a> - 
							<a class="Up <?php echo $menu." ".$Schwarz; ?>" href="videos.php<?php echo Url_erstellen("la", "brasilien"); ?>&amp;lan=1">Brasilien</a> - 
							<a class="Up <?php echo $menu." ".$Schwarz; ?>" href="videos.php<?php echo Url_erstellen("la", "china"); ?>&amp;lan=1">China</a> - 
							<a class="Up <?php echo $menu." ".$Schwarz; ?>" href="videos.php<?php echo Url_erstellen("la", "dänemark"); ?>&amp;lan=1">D&auml;nemark</a> - 
							<a class="Up <?php echo $menu." ".$Schwarz; ?>" href="videos.php<?php echo Url_erstellen("la", "deutschland"); ?>&amp;lan=1">Deutschland</a> - 
							<a class="Up <?php echo $menu." ".$Schwarz; ?>" href="videos.php<?php echo Url_erstellen("la", "dominikanischerepublic"); ?>&amp;lan=1">Dominikanische Republik</a> - 
							<a class="Up <?php echo $menu." ".$Schwarz; ?>" href="videos.php<?php echo Url_erstellen("la", "england"); ?>&amp;lan=1">England</a> - 
							<a class="Up <?php echo $menu." ".$Schwarz; ?>" href="videos.php<?php echo Url_erstellen("la", "frankreich"); ?>&amp;lan=1">Frankreich</a> - 
							<a class="Up <?php echo $menu." ".$Schwarz; ?>" href="videos.php<?php echo Url_erstellen("la", "griechenland"); ?>&amp;lan=1">Griechenland</a> - 
							<a class="Up <?php echo $menu." ".$Schwarz; ?>" href="videos.php<?php echo Url_erstellen("la", "hongkong"); ?>&amp;lan=1">Hongkong</a> - 
							<a class="Up <?php echo $menu." ".$Schwarz; ?>" href="videos.php<?php echo Url_erstellen("la", "indien"); ?>&amp;lan=1">Indien</a> - 
							<a class="Up <?php echo $menu." ".$Schwarz; ?>" href="videos.php<?php echo Url_erstellen("la", "italien"); ?>&amp;lan=1">Italien</a> - 
							<a class="Up <?php echo $menu." ".$Schwarz; ?>" href="videos.php<?php echo Url_erstellen("la", "japan"); ?>&amp;lan=1">Japan</a> - 
							<a class="Up <?php echo $menu." ".$Schwarz; ?>" href="videos.php<?php echo Url_erstellen("la", "kroatien"); ?>&amp;lan=1">Kroatien</a> - 
							<a class="Up <?php echo $menu." ".$Schwarz; ?>" href="videos.php<?php echo Url_erstellen("la", "litauen"); ?>&amp;lan=1">Litauen</a> - 
							<a class="Up <?php echo $menu." ".$Schwarz; ?>" href="videos.php<?php echo Url_erstellen("la", "luxemburg"); ?>&amp;lan=1">Luxemburg</a> -
							<a class="Up <?php echo $menu." ".$Schwarz; ?>" href="videos.php<?php echo Url_erstellen("la", "niederlande"); ?>&amp;lan=1">Niederlande</a> -
							<a class="Up <?php echo $menu." ".$Schwarz; ?>" href="videos.php<?php echo Url_erstellen("la", "nordkorea"); ?>&amp;lan=1">Nordkorea</a> - 
							<a class="Up <?php echo $menu." ".$Schwarz; ?>" href="videos.php<?php echo Url_erstellen("la", "österreich"); ?>&amp;lan=1">&Ouml;sterreich</a> - 
							<a class="Up <?php echo $menu." ".$Schwarz; ?>" href="videos.php<?php echo Url_erstellen("la", "polen"); ?>&amp;lan=1">Polen</a> - 
							<a class="Up <?php echo $menu." ".$Schwarz; ?>" href="videos.php<?php echo Url_erstellen("la", "portugal"); ?>&amp;lan=1">Portugal</a> - 
							<a class="Up <?php echo $menu." ".$Schwarz; ?>" href="videos.php<?php echo Url_erstellen("la", "rumänien"); ?>&amp;lan=1">Rum&auml;nien</a> - 
							<a class="Up <?php echo $menu." ".$Schwarz; ?>" href="videos.php<?php echo Url_erstellen("la", "russland"); ?>&amp;lan=1">Russland</a> - 
							<a class="Up <?php echo $menu." ".$Schwarz; ?>" href="videos.php<?php echo Url_erstellen("la", "schweden"); ?>&amp;lan=1">Schweden</a> - 
							<a class="Up <?php echo $menu." ".$Schwarz; ?>" href="videos.php<?php echo Url_erstellen("la", "serbien"); ?>&amp;lan=1">Serbien</a> - 
							<a class="Up <?php echo $menu." ".$Schwarz; ?>" href="videos.php<?php echo Url_erstellen("la", "singapur"); ?>&amp;lan=1">Singapur</a> - 
							<a class="Up <?php echo $menu." ".$Schwarz; ?>" href="videos.php<?php echo Url_erstellen("la", "slowakei"); ?>&amp;lan=1">Slowakei</a> - 
							<a class="Up <?php echo $menu." ".$Schwarz; ?>" href="videos.php<?php echo Url_erstellen("la", "slowenien"); ?>&amp;lan=1">Slowenien</a> - 
							<a class="Up <?php echo $menu." ".$Schwarz; ?>" href="videos.php<?php echo Url_erstellen("la", "spanien"); ?>&amp;lan=1">Spanien</a> - 
							<a class="Up <?php echo $menu." ".$Schwarz; ?>" href="videos.php<?php echo Url_erstellen("la", "korea"); ?>&amp;lan=1">S&uuml;dkorea</a> - 
							<a class="Up <?php echo $menu." ".$Schwarz; ?>" href="videos.php<?php echo Url_erstellen("la", "taiwan"); ?>&amp;lan=1">Taiwan</a> - 
							<a class="Up <?php echo $menu." ".$Schwarz; ?>" href="videos.php<?php echo Url_erstellen("la", "tschechische"); ?>&amp;lan=1">Tschechische Republik</a> - 
							<a class="Up <?php echo $menu." ".$Schwarz; ?>" href="videos.php<?php echo Url_erstellen("la", "türkei"); ?>&amp;lan=1">T&uuml;rkei</a> - 
							<a class="Up <?php echo $menu." ".$Schwarz; ?>" href="videos.php<?php echo Url_erstellen("la", "ukraine"); ?>&amp;lan=1">Ukraine</a> - 
							<a class="Up <?php echo $menu." ".$Schwarz; ?>" href="videos.php<?php echo Url_erstellen("la", "ungarn"); ?>&amp;lan=1">Ungarn</a> - 
							<a class="Up <?php echo $menu." ".$Schwarz; ?>" href="videos.php<?php echo Url_erstellen("la", "USA"); ?>&amp;lan=1">USA</a> - 
							<a class="Up <?php echo $menu." ".$Schwarz; ?>" href="videos.php<?php echo Url_erstellen("la", "weissrussland"); ?>&amp;lan=1">Weissrussland</a><br/><br/>					
<?php						
						}
						
						// Ausgabe des ausgewählten Landes (mit Link zu Suche nach diesem Land)
						if (empty($_GET['la'])) {$la = "australien";} else {$la = $_GET['la'];}
						if (empty($_GET['Lang'])) {echo "<h3 class='show'>Alle Spieler aus <a title='Alle L&auml;nderspiele (".$la.")' href='videos.php".Url_erstellen("", "")."&amp;lan=1&amp;la=".$la."&amp;Suche="; Laendernamen2 ($la); echo "' class='".$Schwarz." ".$menu." Up'>";}
						else { echo "<h3 class='show'>All players from <a title='All international matches ("; Laendernamen ($la); echo ")' href='videos.php".Url_erstellen("", "")."&amp;Lang=1&amp;lan=1&amp;la=".$la."&amp;Suche="; Laendernamen ($la); echo "' class='".$Schwarz." ".$menu." Up'>";}
						Laendernamen ($la); echo ' <img width="25px" height="15px" src="Flaggen/'.$la.'.png" alt=""/></a></h3>';
					
						// Suche alle Spieler raus, die für das ausgewählte Land im array AlleSpieler existieren (Damen und Herren)
						// Ausgabe allerdings nur wenn Spieler auch weiter oben gefunden wurde (in üÜberprüfung der Filtereinstellungen)
						echo "<br/><br/><table class='backfarbe' border='1' width='100%' rules='rows'><tr><td><b>";
						Sprache ("HERREN", "MEN");
						echo "</b></td><td><b>";
						Sprache ("DAMEN", "WOMEN");
						echo "</b></td></tr><tr><td>";
						$alle = Land_suche_m ($la);
						for ($i=0; $i < count($alle); $i++) {
							$hilf = $alle[$i];
							if (empty($alle4) or in_array($hilf, $alle4)) {
								echo "<a class='".$menu." ".$Schwarz."' href='videos.php".Url_erstellen("Na", "$hilf")."&amp;Na2=0&amp;Nam=0'>".$hilf."</a><br/>";
							}
						}
						echo "</td><td>";
						$alle = Land_suche_w ($la);
						for ($i=0; $i < count($alle); $i++) {
							$hilf = $alle[$i];
							if (empty($alle4) or in_array($hilf, $alle4)) {
								echo "<a class='".$menu." ".$Schwarz."' href='videos.php".Url_erstellen("Na", "$hilf")."&amp;Na2=0&amp;Nam=0'>".$hilf."</a><br/>";
							}
						}
						echo "</td></tr></table><br/>";
						
						if (!empty($_GET['Na']) and $_GET['Art'] != "Lustig") {
							echo "<div class='h50'><a class='Live_link w180' href='videos.php".Url_erstellen("", "")."'><b>&nbsp;&nbsp;";
							Sprache ("Zweiten Spieler w&auml;hlen", "Choose second player");
							echo "&nbsp;&nbsp;</b></a></div><br/><br/>";
						}
					}
					
					// Falls keine Filteroption ausgewählt oder zuviele Spieler in Vidoes oder zuviele Videos gefunden wurden,
					// gib hier "Standard" aller Spieler aus (nach Ländern sortiert)
					else if (!$noausgabe) {
						
						// alle Dateiennamen auslesen
						$handle=opendir ("Lander");
						$Zähler = 0;
						while ($datei_la[$Zähler] = readdir ($handle)) {
							if (strpos($datei_la[$Zähler], ".txt") === false) {}
							else {
								$Zähler++;
							}
						}
						closedir($handle);

						$la_ar = array();
						$Zähler = -1;
						for ($i=0; $i < count($datei_la); $i++)	{								
							$datei_la2 = file("Lander/".$datei_la[$i], FILE_IGNORE_NEW_LINES);
							for ($j=0; $j < count($datei_la2); $j++) {		
								if (empty($alle4) or in_array($datei_la2[$j], $alle4)) {
									$hilf = preg_replace("/.txt/i", '', $datei_la[$i]);
									$Zähler++;
									$la_ar[$Zähler] = $hilf;																		
									break;
								}
							}
						}							
						if (!empty($_GET['Lang'])) {						
?>				
							<div align="center"><h3 class="show">Choose player</h3><br/>
<?php						
							if (!empty($name)) {
								echo "<a class='".$menu."' href='videos.php?Art=".$_GET['Art']."&amp;Na=".$name."&amp;Lang=1'> (Show all videos from <h4 class='show'>".$name."</h4>)</a><br/>";
							}
?>	
							</div><br/>
<?php							
							for ($i=0; $i < count($la_ar); $i++)	{
								$la_ar2[$i] = Laendernamen_return($la_ar[$i]);							
							}
							
							// sortiere alle arrays alphabetisch
							$tausch = true;
							for ($k=count($la_ar2)-1; $k > 0 and $tausch; $k--) {
								$tausch = false;
								for ($j=0; $j < $k; $j++) {
									$eins = strtoupper($la_ar2[$j][0]);
									$zwei = strtoupper($la_ar2[$j+1][0]);
									$counter = 0;
									if ($la_ar2[$j] != $la_ar2[$j+1]) {
										while ($zwei == $eins) {
											$counter++;
											$eins = strtoupper($la_ar2[$j][$counter]);
											$zwei = strtoupper($la_ar2[$j+1][$counter]);											
										}
									}
									if ($eins > $zwei) {
										$temp = $la_ar2[$j];
										$la_ar2[$j] = $la_ar2[$j+1];
										$la_ar2[$j+1] = $temp;
									
										$temp = $la_ar[$j];
										$la_ar[$j] = $la_ar[$j+1];
										$la_ar[$j+1] = $temp;
										$tausch = true;
									}
								}
							}

							for ($i=0; $i < count($la_ar); $i++)	{
								echo '<a class="Up Un-menu Schwarz" href="videos.php'.Url_erstellen("la", $la_ar[$i]).'&amp;lan=1">'.$la_ar2[$i].'</a> - ';
							}
						}
						else {
?>						
							<div align="center"><h3 class="show">W&auml;hle Spieler</h3><br/>
<?php						
							if (!empty($name)) {
								echo "<a class='".$menu."' href='videos.php?Art=".$_GET['Art']."&amp;Na=".$name."'> (Alle Videos von <h4 class='show'>".$name."</h4> anzeigen)</a><br/>";
							}
							echo "</div><br/>";
							
							// sortiere alle arrays alphabetisch
							$tausch = true;
							for ($k=count($la_ar)-1; $k > 0 and $tausch; $k--) {
								$tausch = false;
								for ($j=0; $j < $k; $j++) {
									$eins = strtoupper($la_ar[$j][0]);
									$zwei = strtoupper($la_ar[$j+1][0]);
									if ($eins == "ö") {$eins = "O";}
									if ($zwei == "ö") {$zwei = "O";}
									$counter = 0;
									if ($la_ar[$j] != $la_ar[$j+1]) {
										while ($zwei == $eins) {
											$counter++;
											$eins = strtoupper($la_ar[$j][$counter]);
											$zwei = strtoupper($la_ar[$j+1][$counter]);		
											if ($eins == "Ö") {$eins = "O";}
											if ($zwei == "Ö") {$zwei = "O";}
										}
									}
									if ($eins > $zwei) {
										$temp = $la_ar[$j];
										$la_ar[$j] = $la_ar[$j+1];
										$la_ar[$j+1] = $temp;
										$tausch = true;
									}
								}
							}
							
							
							
							for ($i=0; $i < count($la_ar); $i++)	{
								echo '<a class="Up Un-menu Schwarz" href="videos.php'.Url_erstellen("la", $la_ar[$i]).'&amp;lan=1">'.Laendernamen_return($la_ar[$i]).'</a> - ';
							}
						}
						echo "<br/><br/>";

						// Ausgabe des ausgewählten Landes (mit Link zu Suche nach diesem Land)
						if (empty($_GET['la']) or !in_array($_GET['la'], $la_ar) ) {
						if (!empty($la_ar[0]))	{$la = $la_ar[0];} else {$la = "australien";}} else {$la = $_GET['la'];}
						if (empty($_GET['Lang'])) {echo "<h3 class='show'>Alle Spieler aus <a title='Alle L&auml;nderspiele (".$la.")' href='videos.php".Url_erstellen("", "")."&amp;lan=1&amp;la=".$la."&amp;Suche="; Laendernamen2 ($la); echo "' class='".$Schwarz." ".$menu." Up'>";}
						else { echo "<h3 class='show'>All players from <a title='All international matches ("; Laendernamen ($la); echo ")' href='videos.php".Url_erstellen("", "")."&amp;Lang=1&amp;lan=1&amp;la=".$la."&amp;Suche="; Laendernamen ($la); echo "' class='".$Schwarz." ".$menu." Up'>";}
						Laendernamen ($la); echo ' <img width="25px" height="15px" src="Flaggen/'.$la.'.png" alt=""/></a></h3>';
					
						// Suche alle Spieler raus, die für das ausgewählte Land im array AlleSpieler existieren (Damen und Herren)
						// Ausgabe allerdings nur wenn Spieler auch weiter oben gefunden wurde (in üÜberprüfung der Filtereinstellungen)
						echo "<br/><br/><table class='backfarbe' border='1' width='100%' rules='rows'><tr><td><b>";
						Sprache ("HERREN", "MEN");
						echo "</b></td><td><b>";
						Sprache ("DAMEN", "WOMEN");
						echo "</b></td></tr><tr><td>";
						$alle = Land_suche_m ($la);
						for ($i=0; $i < count($alle); $i++) {
							$hilf = $alle[$i];
							if (empty($alle4) or in_array($hilf, $alle4)) {
								echo "<a class='".$menu." ".$Schwarz."' href='videos.php".Url_erstellen("Na", "$hilf")."&amp;Na2=0&amp;Nam=0'>".$hilf."</a><br/>";
							}
						}
						echo "</td><td>";
						$alle = Land_suche_w ($la);
						for ($i=0; $i < count($alle); $i++) {
							$hilf = $alle[$i];
							if (empty($alle4) or in_array($hilf, $alle4)) {
								echo "<a class='".$menu." ".$Schwarz."' href='videos.php".Url_erstellen("Na", "$hilf")."&amp;Na2=0&amp;Nam=0'>".$hilf."</a><br/>";
							}
						}
						echo "</td></tr></table><br/>";
						
						if (!empty($_GET['Na']) and $_GET['Art'] != "Lustig") {
							echo "<div class='h50'><a class='Live_link w180' href='videos.php".Url_erstellen("", "")."'><b>&nbsp;&nbsp;";
							Sprache ("Zweiten Spieler w&auml;hlen", "Choose second player");
							echo "&nbsp;&nbsp;</b></a></div><br/><br/>";
						}
					}
					
				}				
				
				
				// Ausgabe der Ergebnisse (TURNIERE)
				echo "</td><td valign='top' width='40%'><div align='center'><h3 class='show'>";	
				Sprache ("W&auml;hle Turnier", "Choose tournament");
				echo "</h3><br/>";
				if (!empty($Tu)) {
					echo "<a class='".$menu."' href='videos.php?Art=".$_GET['Art']."&amp;Tu=".$Tu;
					Sprache ("'> (Alle Videos der <h4 class='show'>".$Tu."</h4> anzeigen", "&amp;Lang=1'> (Show all videos from the <h4 class='show'>".$Tu."</h4>");
					echo ")</a><br/>";
				}
				echo "</div><br/>";
				if (Filter_leer3()) {
					for ($i=0; $i < count($AlleTurniere); $i++) {
						$hilf = $AlleTurniere[$i];
						echo "<a class='Un-menu Schwarz' href='videos.php".Url_erstellen("Tu", "$hilf")."'>".$hilf."</a><br/>";
					}
				}
				
				else {
				
					// Filtereinstellungen checken (TURNIERE)
					$ergebnis3 = mysql_query("SELECT Turnier FROM video WHERE
					(test1 = '$name' OR Name_ID1 = '$name' OR Name_ID2 = '$name' OR Name_ID3 = '$name' OR Name_ID4 = '$name') AND 
					(test1 = '$Na2' OR Name_ID1 = '$Na2' OR Name_ID2 = '$Na2' OR Name_ID3 = '$Na2' OR Name_ID4 = '$Na2') AND 
					(test = $Ge OR Geschlecht = $Ge OR Geschlecht = $Ge-1 OR Geschlecht = $Ge-20 OR Geschlecht = $Ge-2 OR Geschlecht = $Ge-4 OR Geschlecht = $Ge+4) AND
					(Quali >= $Qu AND Quali != '9') AND
					(test = $Ja OR Jahr = $Ja) AND
					(test1 = '$Up' OR Uploader = '$Up') AND
					(U21 = $U21 OR U21 = $U21b) AND
					(test = $Spe OR FULL_MATCH = $Spe) AND
					(Bewertungsdurchschnitt >= $Be) ORDER BY Jahr DESC");
					
					$Zähler = 0;
					$noausgabe = true;
					while($row3[$Zähler] = mysql_fetch_object($ergebnis3)) {											
						$Zähler++;
					}
					
					$Zähler = count($row3) - 1;
					unset ($row3[$Zähler]);	

					// ALLE TURNIERE AUSGEBEN 
					// Suche alle Turniere raus, mit Anzahl der verfügbaren Videos
					$alle3 = array ();
					$Zähler = -1;
					$noausgabe = true;
					for ($i=0; $i < count($row3); $i++) {
						$turnier = $row3[$i]->Turnier;	
						if (!empty($turnier) and ($Tu == "0" or $turnier != $Tu)) {			
							if (!in_array($turnier, $alle3)) {
								$Zähler++;
								$alle3[$Zähler] = $turnier;
							}
						}
						
					}

					usort($alle3, "strcasecmp");
						
					for ($i=0; $i < count($alle3); $i++) {
						$hilf = $alle3[$i];
						echo "<a class='Un-menu Schwarz' href='videos.php".Url_erstellen("Tu", "$hilf")."'>".$hilf."</a><br/>";
					}			
				}
			
				echo "</td></tr></table>";
				
			}
			
			// Falls spezielle Videos, nur Spieler aus spezielle Videos auswählbar
			else if ($_GET['Art'] != "Neu") {
				
				
				
				// Hole alle entprchenden Videos aus Datenbank

				if (empty($_GET['Up'])) {
					$Up = "0";
				}
				else {
					$Up = $_GET['Up'];
				}
				if (empty($_GET['Tu'])) {
					$Tu = 0;
				}
				else {
					$Tu = $_GET['Tu'];
				}
				if (empty($_GET['Tul'])) {
					$Tul = 0;
				}
				else {
					$Tul = $_GET['Tul'];
				}
				if (empty($_GET['Na'])) {
					$name = 0;
				}
				else {
					$name = $_GET['Na'];
				}
				if (empty($_GET['Ja'])) {
					$Ja = 0;
				}
				else {
					$Ja = $_GET['Ja'];
				}
				if (empty($_GET['Qu'])) {
					$Qu = -1;
				}
				else {
					$Qu = $_GET['Qu'];
				}
				if (empty($_GET['Be'])) {
					$Be = 0;
				}
				else {
					$Be = $_GET['Be'];
				}
				if (empty($_GET['Ge'])) {
					$Ge = 0;
				}
				else {
					$Ge = $_GET['Ge'];
				}
				
				$ergebnis5 = mysql_query("SELECT Name, Name_en, Suchen FROM videolustig WHERE
				(test = $Ge OR Geschlecht = $Ge OR Geschlecht = $Ge-1 OR Geschlecht = $Ge-20 OR Geschlecht = $Ge-2 OR Geschlecht = $Ge-4 OR Geschlecht = $Ge+4) AND
				(Quali >= $Qu AND Quali != '9') AND
				(test = '$Up' OR Uploader = '$Up') AND
				(test = '$Tul' OR Art = '$Tul') AND
				(Bewertungsdurchschnitt >= $Be) ORDER BY Jahr DESC");
				
				if ($Tul == "Tribute" and $Tul != 0) {
					$Zähler = 0;
					$noausgabe = true;
					while($row5[$Zähler] = mysql_fetch_object($ergebnis5)) {					
						$Zähler ++;
					}
					$Zähler = count($row5) - 1;
					unset ($row5[$Zähler]);

					// Suche alle Gegner raus, mit Anzahl der verfügbaren Spielern
					$alle5 = array ();
					$Zähler = -1;
					$such = "";
					for ($i=0; $i < count($row5); $i++) {
						$such = $such." ".$row5[$i]->Name;
					}
				} 
				else {
					$Zähler = 0;
					$noausgabe = true;
					while($row5[$Zähler] = mysql_fetch_object($ergebnis5)) {					
						// Überprüfe auf Spieler/Jahr/-Filter
						$Hilf = $row5[$Zähler]->Name;
						$Hilf2 = $row5[$Zähler]->Name_en;
						$Hilf3 = $row5[$Zähler]->Suchen;
						if (($Tu == 0 or preg_match("/$Tu/i", $Hilf) == true or preg_match("/$Tu/i", $Hilf2) == true or preg_match("/$Tu/i", $Hilf3) == true) and
						($Ja == 0 or preg_match("/$Ja/i", $Hilf) == true or preg_match("/$Ja/i", $Hilf2) == true or preg_match("/$Ja/i", $Hilf3) == true)) {
							$Zähler ++;
						}
					}
					$Zähler = count($row5) - 1;
					unset ($row5[$Zähler]);

					// Suche alle Gegner raus, mit Anzahl der verfügbaren Spielern
					$alle5 = array ();
					$Zähler = -1;
					$such = "";
					
					for ($i=0; $i < count($row5); $i++) {
						$such = $such." ".$row5[$i]->Suchen;
					}
				}	

				// Suche Spieler im AlleSpieler-array um Land rauszufinden (falls nicht im array gefunden speicher unter ANDERE)
				$counter = -1;
				for ($j=0; $j < count($AlleSpieler); $j++) {	
					if ($j%2 == 0) {
						if (strpos($such, $AlleSpieler[$j]) === false) {
						}
						else {	
							if (!in_array($AlleSpieler[$j], $alle5)) {
								$counter++;
								$alle5[$counter] = $AlleSpieler[$j];
							}
						}	
					}
				}
				
				// Falls zuviele Spieler gefunden, mache zwar Berechnugn für später fertig, aber gehe in den "Standard"-Asuageb Modus
				if (count($alle5) > 40) {
					$noausgabe = false;
				}
				
				// Ausgabe nur, falls nicht zuviele Videos gefunden wurden
				if ($noausgabe and count($alle5) != 0) {
					// sortiere ALLE arrays alphabetisch
					$tausch = true;
					for ($k=count($alle5)-1; $k > 0 and $tausch; $k--) {
						$tausch = false;
						for ($j=0; $j < $k; $j++) {
							$eins = strtoupper($alle5[$j][0]);
							$zwei = strtoupper($alle5[$j+1][0]);
							$counter = 0;
							if ($alle5[$j] != $alle5[$j+1]) {
								while ($zwei == $eins) {
									$counter++;
									$eins = strtoupper($alle5[$j][$counter]);
									$zwei = strtoupper($alle5[$j+1][$counter]);
								}
							}
							if ($eins > $zwei) {
								$temp = $alle5[$j];
								$alle5[$j] = $alle5[$j+1];
								$alle5[$j+1] = $temp;
							
								$temp = $alle_count5[$j];
								$alle_count5[$j] = $alle_count5[$j+1];
								$alle_count5[$j+1] = $temp;
								$tausch = true;
							}
						}
					}

					// Ausgabe der Ergebnisse (Spieler)
					echo '<div align="center"><h3 class="show">';
					Sprache ("W&auml;hle Spieler", "Choose player");
					echo "</h3>";
					if (!empty($name)) {
						echo "<br/><a class='".$menu."' href='videos.php?Art=".$_GET['Art']."&amp;Na=".$name;
						Sprache ("'> (Alle Videos von <h4 class='show'>".$name."</h4> anzeigen", "&amp;Lang=1'> (Show all videos from <h4 class='show'>".$name."</h4>");
						echo ")</a>";
					}
					
					echo "</div><br/><table class='backfarbe' border='1' width='100%' rules='rows'><tr><td>";
					$quo = count($alle5)/2 + 1;
					for ($i=0; $i < count($alle5); $i++) {
						if ($i%$quo == 0 and $i != 0) {
						echo "</td><td>";
						}
						$hilf = $alle5[$i];
						echo "<a class='".$menu." ".$Schwarz."' href='videos.php".Url_erstellen("Na", "$hilf")."&amp;Na2=0&amp;Nam=0'>".$hilf."</a><br/>";
					}
					echo "</td></tr></table><br/>";					
				}
				if (!$noausgabe) {
					
					// Suche Spieler im AlleSpieler-array um Land rauszufinden (falls nicht im array gefunden speicher unter ANDERE)
					$la_ar = array();
					$counter = -1;
					for ($j=0; $j < count($alle5); $j++) {	
						for ($i=0; $i < count($AlleSpieler); $i++) {	
							if ($i%2 == 0) {
								if ($alle5[$j] == $AlleSpieler[$i]) {
									if (!in_array($AlleSpieler[$i+1], $la_ar)) {
										$counter++;
										$la_ar[$counter] = $AlleSpieler[$i+1];
									} 
								}
							}
						}	
					}

					// sortiere alle arrays alphabetisch
					$tausch = true;
					for ($k=count($la_ar)-1; $k > 0 and $tausch; $k--) {
						$tausch = false;
						for ($j=0; $j < $k; $j++) {
							$eins = strtoupper($la_ar[$j][0]);
							$zwei = strtoupper($la_ar[$j+1][0]);
							if ($eins == "ö") {$eins = "O";}
							if ($zwei == "ö") {$zwei = "O";}
							$counter = 0;
							if ($la_ar[$j] != $la_ar[$j+1]) {
								while ($zwei == $eins) {
									$counter++;
									$eins = strtoupper($la_ar[$j][$counter]);
									$zwei = strtoupper($la_ar[$j+1][$counter]);		
									if ($eins == "Ö") {$eins = "O";}
									if ($zwei == "Ö") {$zwei = "O";}
								}
							}
							if ($eins > $zwei) {
								$temp = $la_ar[$j];
								$la_ar[$j] = $la_ar[$j+1];
								$la_ar[$j+1] = $temp;
								$tausch = true;
							}
						}
					}					
?>				
					<h3 class='show'><?php Sprache ("W&auml;hle Spieler", "Choose player"); ?></h3>
<?php	
					$name = $_GET['Na'];
					if (!empty($name)) {
						if (empty($_GET['Lang'])) {
							echo "<br/><a class='".$menu."' href='videos.php?Art=".$_GET['Art']."&amp;Na=".$name."&amp;V=".$_GET['V']."'> (Alle Videos von <b>".$name."</b> anzeigen)</a>";
						}
						else {
							echo "<br/><a class='".$menu."' href='videos.php?Art=".$_GET['Art']."&amp;Na=".$name."&amp;Lang=1&amp;V=".$_GET['V']."'> (Show all videos from <b>".$name."</b>)</a>";
						}
					}
					echo "<br/><br/>";

					// Ausgabe der Links der gefundenen Länder
					for ($i=0; $i < count($la_ar); $i++)	{
						echo '<a class="Up Un-menu Schwarz" href="videos.php'.Url_erstellen("la", $la_ar[$i]).'&amp;lan=1">'.Laendernamen_return($la_ar[$i]).'</a> - ';
					}
					
					echo "<br/><br/>";
					
					// Ausgabe des ausgewählten Landes (mit Link zu Suche nach diesem Land)
					if (empty($_GET['la']) or !in_array($_GET['la'], $la_ar) ) {
					if (!empty($la_ar[0]))	{$la = $la_ar[0];} else {$la = "australien";}} else {$la = $_GET['la'];}
					if (empty($_GET['Lang'])) {echo "<h3 class='show'>Alle Spieler aus <a title='Alle L&auml;nderspiele (".$la.")' href='videos.php".Url_erstellen("", "")."&amp;lan=1&amp;la=".$la."&amp;Suche="; Laendernamen2 ($la); echo "' class='".$Schwarz." ".$menu." Up'>";}
					else { echo "<h3 class='show'>All players from <a title='All international matches ("; Laendernamen ($la); echo ")' href='videos.php".Url_erstellen("", "")."&amp;Lang=1&amp;lan=1&amp;la=".$la."&amp;Suche="; Laendernamen ($la); echo "' class='".$Schwarz." ".$menu." Up'>";}
					Laendernamen ($la); echo ' <img width="25px" height="15px" src="Flaggen/'.$la.'.png" alt=""/></a></h3>';
					
					// Suche alle Spieler raus, die für das ausgewählte Land im array AlleSpieler existieren (Damen und Herren)
					// Ausgabe allerdings nur wenn Spieler auch weiter oben gefunden wurde (in üÜberprüfung der Filtereinstellungen)
					echo "<br/><br/><table class='backfarbe' border='1' width='100%' rules='rows'><tr><td><b>";
					Sprache ("HERREN", "MEN");
					echo "</b></td><td><b>";
					Sprache ("DAMEN", "WOMEN");
					echo "</b></td></tr><tr><td>";
					$alle = Land_suche_m ($la);
					for ($i=0; $i < count($alle); $i++) {
						$hilf = $alle[$i];
						if (in_array($hilf, $alle5) or empty($alle5)) {
							echo "<a class='".$menu." ".$Schwarz."' href='videos.php".Url_erstellen("Na", "$hilf")."&amp;Na2=0&amp;Nam=0'>".$hilf."</a><br/>";
						}
					}
					echo "</td><td>";
					$alle = Land_suche_w ($la);
					for ($i=0; $i < count($alle); $i++) {
						$hilf = $alle[$i];
						if (in_array($hilf, $alle5) or empty($alle5)) {
							echo "<a class='".$menu." ".$Schwarz."' href='videos.php".Url_erstellen("Na", "$hilf")."&amp;Na2=0&amp;Nam=0'>".$hilf."</a><br/>";
						}
					}
					echo "</td></tr></table><br/>";
				}

				// Werbung
				echo "<br/>";					
				if (1 == 1) {
				}
				else if ($_COOKIE['Color'] != "3") {
?>			
					<script type="text/javascript"><!--
						google_ad_client = "ca-pub-4142467347337183";
						/* Videosuche grau */
						google_ad_slot = "8859406272";
						google_ad_width = 468;
						google_ad_height = 60;
						//-->
					</script>
					<script type="text/javascript"
						src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
					</script>
<?php
				}
				else {
?>				
					<script type="text/javascript"><!--
						google_ad_client = "ca-pub-4142467347337183";
						/* Videosuche */
						google_ad_slot = "9134296856";
						google_ad_width = 468;
						google_ad_height = 60;
						//-->
					</script>
					<script type="text/javascript"
						src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
					</script>
<?php
				}
			}
			else {
			// Werbung			
				if (1 == 1) {
				}
				else if ($_COOKIE['Color'] != "3") {
?>			
					<br/>
					<script type="text/javascript"><!--
					google_ad_client = "ca-pub-4142467347337183";
					/* Videosuche Rich Media grau */
					google_ad_slot = "6796806175";
					google_ad_width = 300;
					google_ad_height = 250;
					//-->
					</script>
					<script type="text/javascript"
					src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
					</script>
<?php
				}
				else {
?>				
					<br/>
					<script type="text/javascript"><!--
					google_ad_client = "ca-pub-4142467347337183";
					/* Videosuche Rich Media */
					google_ad_slot = "5603560180";
					google_ad_width = 300;
					google_ad_height = 250;
					//-->
				</script>
				<script type="text/javascript"
					src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
				</script>
<?php
				}
			}
		}
		if ($_GET['Art'] != "Zufall") {
		echo "<br/><br/><hr align='left' width='100%'/><br/><p>";
		if (count($upper_blocked) > 0) {
			echo "<strong>".Sprache2 ("VORSICHT - du hast Youtube Uploader geblockt", "ATTENTION - you have blocked youtube uploader").'</strong>
			<a class="Un-menu" href="Youtube-Uploader.php?Art=You">'.Sprache2("Einstellungen &auml;ndern", "change selection").'</a><br/><br/>';
		}
		
		Sprache ("Auf dieser Seite findst du ", "On this site there are ");
		
		switch ($_GET['Art']) {
			case "Zufall": if (empty($_GET['Lang'])) {echo "ein Zufalls Tischtennis Video";} else {echo "a random table tennis video";} break; 
			case "Alle": if (empty($_GET['Lang'])) {echo "Tischtennis Videos";} else {echo "Table tennis videos";} break; 
			case "Neu": 
				if (empty($_GET['Lang'])) {
					echo "die neuesten Tischtennis Videos und aktuelle Tischtennis Videos";
				} 
				else {
					echo "the new, current, latest table tennis videos";
				} 
			break; 
			case "Lustig": 
				if (empty($_GET['Tul'])) {
					if (empty($_GET['Lang'])) {				
						echo "spezielle Tischtennis Videos";
					} 
					else {
						echo "special table tennis videos";
					} 
				}				
				else if ($_GET['Tul'] == "Antik") {
					if (empty($_GET['Lang'])) {				
						echo "alte, antike Tischtennis Videos";
					} 
					else {
						echo "old, antique table tennis videos";
					} 
				}
				else if ($_GET['Tul'] == "Doku") {
					if (empty($_GET['Lang'])) {				
						echo "Tischtennis Videos Dokumentationen";
					} 
					else {
						echo "table tennis videos documentation";
					} 
				}
				else if ($_GET['Tul'] == "Lern") {
					if (empty($_GET['Lang'])) {				
						echo "Tischtennis Lernvideos, Tischtennis Lehrvideos, unter anderem Tischtennis Aufschlag (
						Tischtennis Aufschl&auml;ge) auch Tischtennis für Anf&auml;nger";
					} 
					else {
						echo "table tennis learning videos, table tennis serve (table tennis service) also
						table tennis for beginners";
					} 
				}
				else if ($_GET['Tul'] == "Lustig") {
					if (empty($_GET['Lang'])) {				
						echo "lustige Tischtennis Videos";
					} 
					else {
						echo "funny table tennis videos";
					} 
				}
				else if ($_GET['Tul'] == "Show") {
					if (empty($_GET['Lang'])) {				
						echo "Tischtennis Videos Showkampf";
					} 
					else {
						echo "table tennis videos show match";
					} 
				}
				else if ($_GET['Tul'] == "Training") {
					if (empty($_GET['Lang'])) {				
						echo "Tischtennis Training Videos";
					} 
					else {
						echo "table tennis training videos";
					} 
				}
				else if ($_GET['Tul'] == "Tribute") {
					if (empty($_GET['Lang'])) {				
						echo "Tribute Tischtennis Videos";
					} 
					else {
						echo "Tribute table tennis videos";
					} 
				}
				else if ($_GET['Tul'] == "Zusammenfassung") {
					if (empty($_GET['Lang'])) {		
						echo "Tischtennis Videos Zusammenfassung";
					} 
					else {
						echo "table tennis videos summary";
					} 
				}
				else if ($_GET['Tul'] == "Interviews") {
					if (empty($_GET['Lang'])) {
						echo "Interviews mit Tischtennis Spielern";
					} 
					else {
						echo "Interviews with table tennis players";
					} 	
				}
				break;
			case "F": if (empty($_GET['Lang'])) {echo "Deine Favoriten";} else {echo "Your favorites";} break;
		} 
		
		if (!empty($_GET['Na'])) {$Na = $_GET['Na']; if ($Na == "SUSS Christian") {$Na = "S&Uuml;SS Christian";} if ($Na == "ROSSKOPF Jorg") {$Na = "ROSSKOPF J&ouml;rg";}
		if (empty($_GET['Lang'])) {echo " mit ".$Na;} else {echo " with ".$Na;} echo " (".Vertausch($Na).")";}
		if (!empty($_GET['Na2'])) {if (empty($_GET['Lang'])) {echo " und mit ".$_GET['Na2'];} else {echo " and with ".$_GET['Na2'];} echo " (".Vertausch($_GET['Na2']).")";} 
		if (!empty($_GET['Tu'])) { $Tu = $_GET['Tu'];
			if (strcasecmp($Tu, "DTTL") == 0) {
				Sprache (" / Deutsche Tischtennisliga, Tischtennis Bundesliga", " / German table tennis league, german league");
			}
			else if (strcasecmp($Tu, "WTTC") == 0) {
				Sprache (" / Tischtennis WM, Tischtennis Weltmeisterschaft", " / World Table Tennis Championships, Table Tennis World Championship");
			}
			else if (strcasecmp($Tu, "WTTC (Team)") == 0) {
				Sprache (" / Tischtennis Mannschafts WM, Tischtennis Team WM, Tischtennis Mannschafts Weltmeisterschaft", 
				" / World Team Table Tennis Championships, Team Table Tennis World Championship");
			}
			else if (strcasecmp($Tu, "ETTC") == 0) {
				Sprache (" / Tischtennis EM, Tischtennis Europameisterschaft, Tischtennis Europameisterschaften", 
				" / European Table Tennis Championships, Table Tennis European Championship");
			}
			else if (strcasecmp($Tu, "ETTC (Team)") == 0) {
				Sprache (" / Tischtennis Mannschafts EM, Tischtennis Mannschafts Europameisterschaft, Tischtennis Mannschafts Europameisterschaften", 
				" / European Team Table Tennis Championships, Team Table Tennis European Championship");
			}
			else if (strcasecmp($Tu, "Olympics") == 0) {
				Sprache (" / Tischtennis Olympiade, Tischtennis Olympischen Spiele", 
				" / table tennis olympics");
			}
			else if (strcasecmp($Tu, "Olympics (Team)") == 0) {
				Sprache (" / Tischtennis Mannschafts Olympiade, Tischtennis Mannschafts Olympischen Spiele", 
				" / table tennis team olympics");
			}
			else if (strcasecmp($Tu, "WJTTC (Junior)") == 0) {
				Sprache (" / World Junior Table Tennis Championships", " / World Junior Table Tennis Championships");
			}
			else {
				Sprache (" / ".preg_replace("/Championships/i", 'Meisterschaft, Meisterschaften', $_GET['Tu']), 
				" / ".$_GET['Tu']);
			}
		}
		if (!empty($_GET['Ja'])) {Sprache (" von ".$_GET['Ja'], " from ".$_GET['Ja']);} 
		switch ($_GET['Qu']) {
			case "1": if (empty($_GET['Lang'])) {echo " ohne schlechte Qualit&auml;t";} else {echo " without bad image quality";} break; 
			case "2": if (empty($_GET['Lang'])) {echo " in guter und super Qualit&auml;t";} else {echo " in good and super image quality";} break; 
			case "3": if (empty($_GET['Lang'])) {echo " in super Qualit&auml;t";} else {echo " in super image quality";} break;
			default:break;
		}	
		switch ($_GET['Spe']) {
			case "1": if (empty($_GET['Lang'])) {echo " - Ganze Tischtennis Spiele";} else {echo " - full table tennis matches";} break; 
			case "3": if (empty($_GET['Lang'])) {echo " - Ganze Tischtennis Spiele, Kurzform";} else {echo " - full table tennis matches, short form";} break; 
			case "2": echo " - Highlights"; break;
			default:break;
		}
		if (!empty($_GET['Up'])) {Sprache (" vom You Tube Uploader ", " from the you tube uploader "); echo $_GET['Up']." (You Tube Video)";}		
		echo "</p>";
		Sprache ("Viel Spass beim schauen der Tischtennis Videos w&uuml;nscht TTvideos.de", 
		"Have fun with the table tennis videos on TTvideos.de");

		
		if ($_GET['Art'] == "Neu") {
			$ergebnis_newturn = mysql_query("SELECT * FROM neusteturniere ORDER BY ID DESC LIMIT 6") or die(mysql_error());
			$Zähler = 0;
			while($row_newturn[$Zähler] = mysql_fetch_object($ergebnis_newturn)) {		
				$Zähler++;
			}
			$Zähler = count($row_newturn) - 1;
			unset ($row_newturn[$Zähler]);
			
			/*
			echo '<p class="border_neu">';
			if (empty($_GET['Lang'])) {
				echo "<b>Wähle ein Turnier, um die neuesten Videos dieses Turniers angezeigt zu bekommen:</b><br/>";
				for ($i=5; $i > -1; $i--) {
					echo '-- <a class="'.$menu.'" href="videos.php?Art=Neu&amp;Tu='.$row_newturn[$i]->turnier.'&amp;Ja='.$row_newturn[$i]->jahr.'">'.$row_newturn[$i]->turnier.'</a> ('.$row_newturn[$i]->text.')<br/>';	
				}
			} 
			else {
				echo "<b>Choose a tournament to get to the latest videos of this tournament:</b><br/>";
				for ($i=5; $i > -1; $i--) {
					echo '-- <a class="'.$menu.'" href="videos.php?Art=Neu&amp;Lang=1&amp;Tu='.$row_newturn[$i]->turnier.'&amp;Ja='.$row_newturn[$i]->jahr.'">'.$row_newturn[$i]->turnier.'</a> ('.$row_newturn[$i]->text_en.')<br/>';	
				}
			} 
			echo '</p>';
			*/
		}
		
		
		}
?>	
	</div>
<?php	
	Load_ausgabe ($timestamp_test);
	@MYSQL_CLOSE();
?>
</div>
</body>
</html>