<ul id="shortcuts">
	<li id="s-register"><a href="javascript: void(EffectWeb);" onclick="CTM_Load('?pag=terms&register=true','conteudo','GET');"><!-- Register Shortcut --></a></li>
	<li id="s-download"><a href="javascript: void(EffectWeb);" onclick="CTM_Load('?pag=downloads','conteudo','GET');"><!-- Downloads Shortcut --></a></li>
	<li id="s-vip"><a href="javascript: void(EffectWeb);" onclick="CTM_Load('?pag=vip-cash','conteudo','GET');"><!-- VIP Shortcut --></a></li>
</ul>
<div class="box">
	<script type="text/javascript" src="templates/{Template_Dir}/media/scripts/script.js"></script>
    <div id="slide">
        <div id="coin-slider">
			<a href="<?=L_LinkSlide?>" target="_blank"><img src="<?=L_ImgSlide?>" width="745" height="136" alt=""></a>
			<a href="<?=L_LinkSlide2?>" target="_blank"><img src="<?=L_ImgSlide2?>" width="745" height="136" alt=""></a>
			<a href="<?=L_LinkSlide3?>" target="_blank"><img src="<?=L_ImgSlide3?>" width="745" height="136" alt=""></a>
			<a href="<?=L_LinkSlide4?>" target="_blank"><img src="<?=L_ImgSlide4?>" width="745" height="136" alt=""></a>
			<a href="<?=L_LinkSlide5?>" target="_blank"><img src="<?=L_ImgSlide5?>" width="745" height="136" alt=""></a>
        </div>
    </div>
</div>
<?php if(constant("Show_News") == true){ ?>
<div class="box">
<div class="header">Not&iacute;cias do Servidor</div>
    	<blockquote>{Show_News}</blockquote>
</div>
<?php }if(constant("Board_News") == true){ ?>
<div class="box">
<div class="header">Not&iacute;cias do F&oacute;rum</div>
	<blockquote>{Board_News}</blockquote>
</div>
<?php }if(constant("Show_Warning") == true){ ?>
	{%SHOW_WARNING%}
<?php } if(constant("Siege_Enable") == true){ ?>
<div class="box">
	<div id="castle-siege">
	<?php
        global $CTM_MSSQL;
        $queryco = $CTM_MSSQL->query("SELECT OWNER_GUILD,CONVERT(varchar(5),SIEGE_END_DATE,3) FROM ".MuGen_DB.".dbo.MuCastle_DATA ORDER BY MAP_SVR_GROUP DESC");			
        $guildocs = mssql_fetch_array($queryco);
        echo("<p>Dona do castelo: <a href=\"javascript: void(EffectWeb);\" onclick=\"CTM_Load('?pag=search&guild=".urlencode($guildocs[0])."','conteudo','GET');\">".$guildocs[0]."</a></p>");
        $query = $CTM_MSSQL->query("SELECT G_Mark, G_Master FROM ".MuGen_DB.".dbo.Guild WHERE G_Name='".$guildocs[0]."'");
        $guildcs = mssql_fetch_array($query);
        echo ("<p>Pr&oacute;ximo confronto: <span class=\"green\">".$guildocs[1]." &agrave;s ".Siege_Hour."h.</span></p>");
    ?>
    </div>
</div>
<?php } ?>
<div class="box">
<div class="header">Top's do Servidor</div>
	<div id="outer-div">
		<div id="top-resets">
			<?php
			global $CTM_MSSQL;
			$query = $CTM_MSSQL->query("SELECT TOP 5 Name,".Column_Reset.",CTM_Image FROM ".MuGen_DB.".dbo.Character ORDER BY ".Column_Reset." DESC");
			$cont = NULL;
			while($topresets = mssql_fetch_array($query)){
			$cont++;
				if($topresets[2] == NULL OR empty($topresets[2]) OR !file_exists(Upload_Img."".$topresets[2]."")){
					$photo = Upload_Img."nophoto.gif";
				}else{
					$photo = Upload_Img."".$topresets[2]."";
				}
				echo '<ul class="tops">
				<li class="box-top">
					<a href="javascript: void(EffectWeb);" onclick="CTM_Load(\'?pag=search&amp;char='.$topresets[0].'\', \'conteudo\',\'GET\');">
					<span>'.$topresets[0].'</span>
					<img src="'.$photo.'" width="110" height="103" alt="'.$topresets[0].'">
					<span>( '.$topresets[1].' Resets )</span>
					</a>
				</li>
				</ul>';
				}
			?>
		</div>
		<div id="top-mresets">
			<?php
			global $CTM_MSSQL;
			$query = $CTM_MSSQL->query("SELECT TOP 5 Name,".Column_MReset.",CTM_Image FROM ".MuGen_DB.".dbo.Character ORDER BY ".Column_MReset." DESC");
			$cont = NULL;
			while($topresets = mssql_fetch_array($query)){
			$cont++;
				if($topresets[2] == NULL OR empty($topresets[2]) OR !file_exists(Upload_Img."".$topresets[2]."")){
					$photo = Upload_Img."nophoto.gif";
				}else{
					$photo = Upload_Img."".$topresets[2]."";
				}
				echo '<ul class="tops">
				<li class="box-top">
					<a href="javascript: void(EffectWeb);" onclick="CTM_Load(\'?pag=search&amp;char='.$topresets[0].'\', \'conteudo\',\'GET\');">
					<span>'.$topresets[0].'</span>
					<img src="'.$photo.'" width="110" height="103" alt="'.$topresets[0].'">
					<span>( '.$topresets[1].' M.Resets )</span>
					</a>
				</li>
				</ul>';
				}
			?>
		</div>
		<div id="top-daily">
			<?php
			global $CTM_MSSQL;
			$query = $CTM_MSSQL->query("SELECT TOP 5 Name,".Column_ResetDay.",CTM_Image FROM ".MuGen_DB.".dbo.Character ORDER BY ".Column_ResetDay." DESC");
			$cont = NULL;
			while($topresets = mssql_fetch_array($query)){
			$cont++;
				if($topresets[2] == NULL OR empty($topresets[2]) OR !file_exists(Upload_Img."".$topresets[2]."")){
					$photo = Upload_Img."nophoto.gif";
				}else{
					$photo = Upload_Img."".$topresets[2]."";
				}
				echo '<ul class="tops">
				<li class="box-top">
					<a href="javascript: void(EffectWeb);" onclick="CTM_Load(\'?pag=search&amp;char='.$topresets[0].'\', \'conteudo\',\'GET\');">
					<span>'.$topresets[0].'</span>
					<img src="'.$photo.'" width="110" height="103" alt="'.$topresets[0].'">
					<span>( '.$topresets[1].' Resets )</span>
					</a>
				</li>
				</ul>';
				}
			?>
		</div>
		<div id="top-weekly">
			<?php
			global $CTM_MSSQL;
			$query = $CTM_MSSQL->query("SELECT TOP 5 Name,".Column_ResetWeek.",CTM_Image FROM ".MuGen_DB.".dbo.Character ORDER BY ".Column_ResetWeek." DESC");
			$cont = NULL;
			while($topresets = mssql_fetch_array($query)){
			$cont++;
				if($topresets[2] == NULL OR empty($topresets[2]) OR !file_exists(Upload_Img."".$topresets[2]."")){
					$photo = Upload_Img."nophoto.gif";
				}else{
					$photo = Upload_Img."".$topresets[2]."";
				}
				echo '<ul class="tops">
				<li class="box-top">
					<a href="javascript: void(EffectWeb);" onclick="CTM_Load(\'?pag=search&amp;char='.$topresets[0].'\', \'conteudo\',\'GET\');">
					<span>'.$topresets[0].'</span>
					<img src="'.$photo.'" width="110" height="103" alt="'.$topresets[0].'">
					<span>( '.$topresets[1].' Resets )</span>
					</a>
				</li>
				</ul>';
				}
			?>
		</div>
		<div id="top-monthly">
			<?php
			global $CTM_MSSQL;
			$query = $CTM_MSSQL->query("SELECT TOP 5 Name,".Column_ResetMonth.",CTM_Image FROM ".MuGen_DB.".dbo.Character ORDER BY ".Column_ResetMonth." DESC");
			$cont = NULL;
			while($topresets = mssql_fetch_array($query)){
			$cont++;
				if($topresets[2] == NULL OR empty($topresets[2]) OR !file_exists(Upload_Img."".$topresets[2]."")){
					$photo = Upload_Img."nophoto.gif";
				}else{
					$photo = Upload_Img."".$topresets[2]."";
				}
				echo '<ul class="tops">
				<li class="box-top">
					<a href="javascript: void(EffectWeb);" onclick="CTM_Load(\'?pag=search&amp;char='.$topresets[0].'\', \'conteudo\',\'GET\');">
					<span>'.$topresets[0].'</span>
					<img src="'.$photo.'" width="110" height="103" alt="'.$topresets[0].'">
					<span>( '.$topresets[1].' Resets )</span>
					</a>
				</li>
				</ul>';
				}
			?>
		</div>
		<?php if(constant("Top_Guilds") == true){ ?>
		<div id="top-guild">
			<?php
			global $CTM_MSSQL;
			$query = $CTM_MSSQL->query("SELECT TOP 5 G_Name,G_Mark,G_Score FROM ".MuGen_DB.".dbo.Guild ORDER BY G_Score DESC");
			$cont = NULL;
			while($topguilds = mssql_fetch_array($query)){
			$cont++;
				if($topresets[2] == NULL OR empty($topresets[2]) OR !file_exists(Upload_Img."".$topresets[2]."")){
					$photo = Upload_Img."nophoto.gif";
				}else{
					$photo = Upload_Img."".$topresets[2]."";
				}
				echo "<ul class=\"tops\">
				<li class=\"box-top\">
					<a href=\"javascript: void(EffectWeb);\" onclick=\"CTM_Load('?pag=search&guild=".urlencode($topguilds[0])."','conteudo','GET');\">
					<span>".$cont."º - ".$topguilds[0]."</span>
					<img src=\"?public=logoGuild&amp;code=".urlencode(bin2hex($topguilds[1]))."\" width=\"110\" height=\"103\" alt=\"\">
					<span>( ".$topguilds[2]." Score )</span>
					</a>
				</li>
				</ul>";
				}
			?>
		</div>
        <?php } ?>
    </div>
<script type="text/javascript">
	var aba = new JTabControl("outer-div",710,300);
	aba.addTab("top-resets", "Resets");
	aba.addTab("top-mresets", "Master Resets");
	aba.addTab("top-daily", "Resets Di&aacute;rio");
	aba.addTab("top-weekly", "Resets Semanal");
	aba.addTab("top-monthly", "Resets Mensal");
	aba.addTab("top-guild", "Guild");
</script>
</div>
<?php if(constant("Show_ScreenShots") == true){ ?>
<div class="box">
<div class="header">Screenshots</div>
<?php
	global $CTM_MSSQL;
	$query = $CTM_MSSQL->query("SELECT TOP 5 * FROM ".MSSQL_DB.".dbo.CTM_WebScreenShots ORDER BY Id DESC");
	if(empty($query)){
		echo "<div class=\"info-box\">N&atilde;o h&aacute; ScreenShots adicionadas no momento.</div>";
	}else{
		while($ss = mssql_fetch_array($query)){
			echo '<ul class="tops">
			<li class="box-top">
				<a href="javascript: void(EffectWeb);" onclick="CTM_Load(\'?pag=screenshots&amp;view='.$ss[0].'\', \'conteudo\', \'GET\');">
				<span>Autor: '.$ss[2].'</span>
				<img src="'.Upload_SS.''.$ss[6].'" width="110" height="103" alt="">
				<span>('.$ss[3].' Votos)</span>
			</a>
			</li>
		</ul>';
		}
	}
?>
</div>
<?php } ?>