<script>
function setPointer(theRow, thePointerColor, theNormalBgColor)
{
    var theCells = null;

    if (thePointerColor == '' || typeof(theRow.style) == 'undefined') {
        return false;
    }
    if (typeof(document.getElementsByTagName) != 'undefined') {
        theCells = theRow.getElementsByTagName('td');
    }
    else if (typeof(theRow.cells) != 'undefined') {
        theCells = theRow.cells;
    }
    else {
        return false;
    }

    var rowCellsCnt  = theCells.length;
    var currentColor = null;
    var newColor     = null;
    // Opera does not return valid values with "getAttribute"
    if (typeof(window.opera) == 'undefined'
        && typeof(theCells[0].getAttribute) != 'undefined' && typeof(theCells[0].getAttribute) != 'undefined') {
        currentColor = theCells[0].getAttribute('bgcolor');
        newColor     = (currentColor.toLowerCase() == thePointerColor.toLowerCase())
                     ? theNormalBgColor
                     : thePointerColor;
        for (var c = 0; c < rowCellsCnt; c++) {
            theCells[c].setAttribute('bgcolor', newColor, 0);
        } // end for
    }
    else {
        currentColor = theCells[0].style.backgroundColor;
        newColor     = (currentColor.toLowerCase() == thePointerColor.toLowerCase())
                     ? theNormalBgColor
                     : thePointerColor;
        for (var c = 0; c < rowCellsCnt; c++) {
            theCells[c].style.backgroundColor = newColor;
        }
    }

    return true;
} // end of the 'setPointer()' function
</script>

<table id="main" cellpadding="0" cellspacing="0">
	<tr>
		<td id="maingauche" style="padding-right:10px;">
			<?php include($ARCHIVES_DIR."tag_300x250_bookmaker.html");?>
			<br><br>
			<?php include($ARCHIVES_DIR."tag_300x250.html");?>

		</td>
		<td id="maindroit" class="smallDarkGreen">

<table width=100% border=0 cellpadding="1" cellspacing="0">
<tr>
<td align=right valign=top class=smallDark>

<?php table_ktf_up( $title, '640px', 'green', 1, '14px', '#fff'  ); ?>

<table cellpadding=2 cellspacing=1 bgcolor=#045d14 style="float:right; margin-right:15px;" width=200px>
<tr>
	<form action="<?php echo $sess->action($HIGH_PAGE) ?>" method="post">
    <input type="hidden" name="visu" value="visu">
    <input type="hidden" name="sorting" value="<?php echo $sorting ?>">
    <input type="hidden" name="type_classement" value="<?php echo $type_classement ?>">
    <?php echo $sess->hfield()?> 
	<td height=50 class=stdDark valign=top align=center bgcolor=#FFFFFF style=''>
		<span class=smallBoldDark >Rechercher le joueur :
		</span>
        <input class=inputbg2 type="text" name="name" size="15" value=""<?php echo ($type_classement==$types_classement[0]['Id'])?" disabled":""?>>
        <input align="absmiddle" type="image" name="Voir" src="<?php echo $IMAGES_DIR . "boutons/bouton_valider.gif"?>"  border="0" alt="Voir"<?php echo ($type_classement==$types_classement[0]['Id'])?" disabled":""?>>
		</td>
	</tr>
	</form>
</table>
	<div class="smallDark" style="margin: 0px 3px; text-align:left;">
			Cette page vous permet de consulter votre classement, celui de vos amis, tous les classements de la session en cours et ceux de la session précédente.<br>
			Cliquer sur « Points », « KF », et « Perfects » pour classer les joueurs.<br>
		<br><br><br style="font-size:8px;">
	</div>

<?php
if ($error != "")
	echo "<table cellpadding=3 align=center valign=middle><tr><td class=error>&nbsp;&nbsp;".stripslashes($error)."&nbsp;&nbsp;</td></tr></table>";

	$longueur = 625;
	// la boite mes résultats
	echo "<table cellpadding=0 border=0 cellspacing=0 width=$longueur bgcolor=#FFFFFF>";
	echo "<tr>";
	$largeur_onglet = ceil($longueur / count($types_classement));
	$COULEUR_ONGLET_SELECTIONNE = $BG_COLOR_FOND_2;
	$COULEUR_ONGLET_NON_SELECTIONNE = $BG_COLOR_FOND_3;
	$COULEUR_CADRE_TABLEAU = $BG_COLOR_FOND_1;
//	$BG_COLOR_FOND_1 =$BG_COLOR_FOND_3= '#FFFFFF';
	$BG_COLOR_FOND_3 = '#c6f777';
	$BG_COLOR_FOND_1 = '#FFFFFF';
	$macouleur="#92eb04";
	for ($i = 0 ; $i < count($types_classement) ; $i++)
	{
		print_onglet2($r, $type_classement, $largeur_onglet, $types_classement[$i], $COULEUR_ONGLET_SELECTIONNE, $COULEUR_ONGLET_NON_SELECTIONNE, $COULEUR_ONGLET_SELECTIONNE, $COULEUR_CADRE_TABLEAU,"");
	}

	echo "</tr>";
	echo "<tr><td colspan=".count($types_classement)." bgcolor=".$BG_COLOR_FOND_1.">";
		echo "<table cellpadding=0 border=0 cellspacing=0 bgcolor=#FFFFFF>";
		echo "<tr><td width=1 bgcolor=".$BG_COLOR_FOND_1." align=left valign=top><img src=\"".$IMAGES_DIR."spacer.gif\"></td>";
		echo "<td width=100%>";
		if ($type_classement == $types_classement[0]['Id'])
		{	
		  showFriendScores($player['Id'], $BG_COLOR_FOND_12, $BG_COLOR_FOND_2, "#DFDFDF", $BG_COLOR_FOND_3, $sorting,$macouleur);
		}
		else
		{
			
			if ($type_classement == $types_classement[1]['Id'])
			{	
				showScores($aPlayer['Id'], $BG_COLOR_FOND_12, $BG_COLOR_FOND_2, "#DFDFDF", $BG_COLOR_FOND_3, $sorting,'', $macouleur);
				
			}
			elseif ($type_classement == $types_classement[3]['Id'])
			{
					
				showFoufoot($aPlayer['Id'], $BG_COLOR_FOND_12, $BG_COLOR_FOND_2, "#DFDFDF", $BG_COLOR_FOND_3, $sorting,"",$DATE_ARCHIVAGE);
				
			}
			else
			{		
				
				//echo "sorting = ".$sorting."<br>";		
				//echo "rank2 = ".$rank2."<br>";
				//echo $aPlayerScores['PlayerName']." - ".$aPlayerScores['Id'];		
				
				showOldScores($aPlayerScores['Id'],$rank2, $BG_COLOR_FOND_12, $BG_COLOR_FOND_2, "#DFDFDF", $BG_COLOR_FOND_3, $sorting, $DATE_ARCHIVAGE, $type_classement,'',$macouleur);
				
			}
			echo "<br style=font-size:4px>";
			tableNavDown($HIGH_PAGE, $rank, $MAX_SCORES, $sorting, "smallDarkLink", 435, "#FFFFFF");
			
		}
		echo "</td><td width=1 bgcolor=".$BG_COLOR_FOND_1." align=left valign=top><img src=\"".$IMAGES_DIR."spacer.gif\"></td></tr>";
		echo "<tr><td height=1 colspan=3 bgcolor=".$BG_COLOR_FOND_1." align=left valign=top><img src=\"".$IMAGES_DIR."spacer.gif\"></td></tr>";
		echo "</td></tr></table>";
	echo "</td></tr></table>";

?>
<?php table_ktf_down( '', 1 ); ?>

</td>

</tr>
</table>

		</td>
	</tr>
</table>
