<?php
/*======================================================================*\
|| #################################################################### ||
|| # eGamers of Tomorrow Battlefield 3 Leaderboard                    # ||
|| # ---------------------------------------------------------------- # ||
|| # Dieses Copyright darf nicht entfernt werden                      # ||
|| # This file may not be redistributed in whole or significant part. # ||
|| # ---------------Teil des Bf3 Leaderboards von EoT-----------------# ||
|| #                      http://eot-clan.net                         # ||
|| #################################################################### ||
\*======================================================================*/
  require_once ('inc/config.php');
	require_once ('language/'.$row['language'].'.php');
  require_once ('inc/BattlelogApi/battlelog.api.php');


   $_GET = security::escape($_GET);
   $_POST = security::escape($_POST);
   $battlelog = new BattlelogApiCurl;
   $EoT = new eGamersofTomorrow;
            
 
        $sSql = "
		SELECT 
			ServerName,
			ServerID,
			LastVisit,
			FirstVisit,
			dateLastCheck,
			checkS,
			serverStatus
		FROM 
		  (SELECT 
		    ServerName,
			  ServerID,
			  LastVisit,
			  FirstVisit,
			  dateLastCheck,
			  checkS,
			  serverStatus
		  FROM ".DBPrefix."ServerHistory WHERE serverStatus='0' ORDER BY dateLastCheck ASC) AS t
	   GROUP BY ServerID ORDER BY dateLastCheck ASC LIMIT 4";
    $result = mysql_query($sSql) or $sError = 'Error in Query: ' . mysql_error() . ' in SQL: ' . print_r($sSql, true);
    $sTime = time();
		 while ($data = mysql_fetch_assoc($result)) {
        $server = $battlelog->ServerData($data['ServerID']);
			   if ($server['message'] == "error" && $data['dateLastCheck']+3600 < $sTime && $data['checkS'] < 24){
			      mysql_query("UPDATE ".DBPrefix."ServerHistory SET serverStatus='0',checkS=checkS+1,dateLastCheck={$sTime} WHERE ServerID='{$data['ServerID']}'");
	   }else if ($server['message'] == "error" && $data['dateLastCheck']+3600 < $sTime && $data['checkS'] >= 24){
            mysql_query("DELETE FROM ".DBPrefix."ServerHistory WHERE ServerID='{$data['ServerID']}'");
     }else if ($server['message'] == "ok" ){
     	      mysql_query("UPDATE ".DBPrefix."ServerHistory SET serverStatus='1',checkS='0',dateLastCheck='' WHERE ServerID='{$data['ServerID']}'");
     }
   } 
 
 
  
  if(!isset($_GET["action"])){
    $action = "";
   }else{
   	$action = htmlentities($_GET["action"]);
  }
  
 
  if(!isset($_GET['page'])){
    $page = 1;
   }else{
   	$page = $_GET['page'];
  }
  
  $maxEntrys = 10; 
  $start = $page * $maxEntrys - $maxEntrys; 
  
  $sSql = "SELECT soldiername FROM ".DBPrefix."generalStats";
     $result = mysql_query($sSql) or $sError = 'Error in Query: ' . mysql_error() . ' in SQL: ' . print_r($sSql, true);
		       $aPlayer = array();
		         while ($data = mysql_fetch_assoc($result)) {
		           	$aPlayer[] = $data['soldiername'];
	 	         }
  
  if(isset($_GET['name']) && !empty($_GET['name']) && $_GET['name'] != '' && in_array($_GET['name'],$aPlayer)) {
	 $iPlayer = $_GET['name']; 
 }else{
	include ('error/errorPlayers.html');
   exit;
}
	
  
	  $sWhere = "a.soldiername = '{$iPlayer}' AND serverStatus='1' AND ServerID != ''";	
	    
	$sSql = "
		SELECT 
			a.soldiername,
			a.pid,
			b.ServerName,
			b.ServerID,
			b.LastVisit,
			b.FirstVisit
		FROM 
			  ".DBPrefix."generalStats a
	  Left JOIN 
         ".DBPrefix."ServerHistory b ON a.pid = b.stats_pid
	  WHERE 
			{$sWhere} ORDER BY LastVisit DESC LIMIT $start, $maxEntrys";
	
		$result = mysql_query($sSql) or $sError = 'Error in Query: ' . mysql_error() . ' in SQL: ' . print_r($sSql, true);
    $entrys = mysql_num_rows($result);
		
		$aData = array();
	 while ($data = mysql_fetch_assoc($result)) {
	 	$aData[] = $data;
	}
  ?>
  <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
          "http://www.w3.org/TR/html4/loose.dtd">
   <title><?php echo LANG_GAMESERVER_TITLE.htmlspecialchars($iPlayer); ?></title>
   <?php echo $styleSettings; ?>
   <head>
    <script type="text/javascript" src="js/jquery-1.4.3.min.js"></script>
    <script type="text/javascript" src="js/jquery.fancybox-1.3.4.pack.js"></script>
     <link rel="stylesheet" type="text/css" href="css/jquery.fancybox-1.3.4.css" media="screen" />
   </head>	
       <div class="body_bfLB">   
	           <?php echo $Banner; ?>
        <ul id="statstabs" class="shadetabs" style="margin-top:10px;margin-bottom:-10px;">
            <li><a href="index.php">Leaderboard</a></li>
                      <li><a href="stats.php?name=<?php echo rawurlencode($iPlayer); ?>" >Details</a></li>
        
                      <li><a href="stats.php?name=<?php echo rawurlencode($iPlayer); ?>&action=weapons_vehicles" >Weapons/Vehicles</a></li>
        
                      <?php if ($row['ribbons_box'] == 1){ ?>
                      <li><a href="stats.php?name=<?php echo rawurlencode($iPlayer); ?>&action=awards" >Awards</a></li>
                       <?php } ?>
         
                      <?php if ($row['coop_box'] == 1){ ?>
                      <li><a href="stats.php?name=<?php echo rawurlencode($iPlayer); ?>&action=coop" >Coop</a></li>
                      <?php } ?>
         
                      <?php if ($row['assignments'] == 1){ ?> 
                      <li><a href="stats.php?name=<?php echo rawurlencode($iPlayer); ?>&action=assignments" ><?php echo LANG_GENERAL_ASSIGNMENTS; ?></a></li>
                      <?php } ?>
          
                      <li><a href="stats.php?name=<?php echo rawurlencode($iPlayer); ?>&action=dogtags" >Dogtags</a></li>
        
                      <?php if($row['History'] == 1){ ?>
                      <li><a id="bf3stats" href="history.php?pid=<?php echo $aData[0]['pid']; ?>" >History</a></li>
                      <?php }
        
                        if($row['platform'] == "pc"){ ?>
                      <li><a href="ServerHistory.php?name=<?php echo rawurlencode($iPlayer); ?>" class="selected">S.History</a></li>
                      <?php }
        
                        if($row['battlereports'] == 1){ ?>
                      <li><a href="battlereport.php?name=<?php echo rawurlencode($iPlayer); ?>" >Reports</a></li>
                      <?php } ?>
                      
                       <li><a href="mapstats.php?name=<?php echo rawurlencode($iPlayer); ?>">Mapstats</a></li>
        
      </ul>
				<table class="default">
					<thead>
        <td class="head" colspan="13" cellspacing="0"><?php echo LANG_GAMESERVER_TITLE.htmlspecialchars($iPlayer); ?></td>
        <tr> 
        <th class="object" width="17px"></th> 
         <th class="object" width="120px"><?php echo LANG_GAMESERVER_NAME; ?></th> 
          <th class="object" width="80px"><?php echo LANG_GAMESERVER_MAP; ?></th>
           <th class="object" width="60px"><?php echo LANG_GAMESERVER_SETTING; ?></th>
          <th class="object" width="50px" style="text-align:left"><?php echo LANG_GAMESERVER_PLAYER; ?></th>
         <th class="object" width="65px"><?php echo LANG_GAMESERVER_FIRST; ?></th>
        <th class="object" width="65px"><?php echo LANG_GAMESERVER_LAST; ?></th> 
      </thead> 
        <tbody> 
	  <?
	  if ($page > 1){
			  	$Lpage = '&page='.$page;
			  }else{
			  	$Lpage= "";
			  }
			  $count = 0;

	   foreach ($aData as $data){  

	   	  if ($data['ServerID'] == ""){
		  echo '<tr><td class="result" colspan="10"><b>'.LANG_GAMESERVER_NO.'</b></td>';
		}else{
			$count++;
			   $server = $battlelog->ServerData($data['ServerID']);
			   if ($server['message'] == "error"){
			       mysql_query("UPDATE ".DBPrefix."ServerHistory SET serverStatus='0' WHERE ServerID='{$data['ServerID']}'");
			  }else{	
			  	   mysql_query("UPDATE ".DBPrefix."ServerHistory SET serverStatus='1' WHERE ServerID='{$data['ServerID']}'");  
			    $Queued = '';
			  if ($server['numQueued'] > 0){
			  	$Queued = ' ['.$server['numQueued'].']';
			  }
			  
			  
			  
			  
			  if(!isset($_GET["ServerID"])){
          $ID = "";
         }else{
   	      $ID = $_GET["ServerID"];
        }
			  
			  
			  if ($data['ServerID'] == $ID){
			  	$back =  'style="background-image:url('.$domain.'/img/members.png);"';
			  }else{
			  	$back = "";
			  }			  
			  $HCSETTING = $EoT->settings($server['preset']);
			  ?>
			  	<tr class="hov" <?php echo $back; ?>>
			  		<td class="result"><img style="float:left;margin-left:1px;" src="<?php echo $domain; ?>/img/flags/<?php echo $server['country']; ?>.png"></td>
				  <td class="result"><a href="ServerHistory.php?name=<?php echo rawurlencode($iPlayer); ?>&action=viewServer&ServerID=<?php echo  $data['ServerID'].$Lpage; ?>"><?php echo TRIMNAME($server['name']);?></a></td>
				  <td class="result">
				  	<a class="tooltip"><?php echo $EoT->mapName($server['map']);?>
				  	  <span style='margin-top:-65px;margin-left:-195px;width:190px;z-index:1000;'>
				  	    <img src="<?php echo $domain; ?>/img/gameserver/maps/<?php echo $server['map']; ?>.jpg" width="190px" />
				  	  </span>
				  	</a>
				  </td>
				  <td class="result">
				  	<img src="<?php echo $domain; ?>/img/gameserver/icons/<?php echo Settings($server['ranked'],"rank") ; ?>.png" />
				  	<img src="<?php echo $domain; ?>/img/gameserver/icons/<?php echo Settings($server['punkbuster'],"pb") ; ?>.png" />
				  	<img src="<?php echo $domain; ?>/img/gameserver/icons/<?php echo Settings($HCSETTING,"hc") ; ?>.png" />
				  	<img src="<?php echo $domain; ?>/img/gameserver/icons/<?php echo Settings($server['passworded'],"pw") ; ?>.png" />
				  </td>
				  <td class="result" style="text-align:left"><?php echo '<font class="DIVtext">'.$server['numPlayers'].'/'.$server['maxPlayers'].'</font>'.$Queued;?></td>
				  <td class="result"><?php echo $EoT->unix_to_time($data['FirstVisit']); ?></td>
				  <td class="result"><?php echo $EoT->unix_to_time($data['LastVisit']); ?></td>		
			  <?php 
			  }
			}
	  }
	  
 if (count($aData) > 0){ 
    $sSql = "SELECT COUNT(ServerID) AS count FROM ".DBPrefix."ServerHistory WHERE stats_pid = {$aData[0]['pid']} AND serverStatus='1' AND ServerID != ''";
		  $result = mysql_query($sSql) or $sError = 'Error in Query: ' . mysql_error() . ' in SQL: ' . print_r($sSql, true);
		  $data = mysql_fetch_assoc($result);

      $wieviele_seiten = ceil($data['count'] / $maxEntrys);
	
	  echo '<tr>
	        <td class=result colspan=11>
           <b>'.LANG_GAMESERVER_PAGE.'</b>';
    echo $EoT->blaetterfunktion($page,  $wieviele_seiten, 'ServerHistory.php?name='.$iPlayer.'&').' ('.LANG_GAMESERVER_ALL.$data['count'].')</td>';
} 
          echo '</tbody>
         </table>';
     
     
     
     
     if($action == "viewServer") {
     	?>
     	    <script language="javascript" type="text/javascript" src="js/mootools-1.2-core.js"></script>
          <script language="javascript" type="text/javascript" src="js/mootools-1.2-more.js"></script>
          <script language="javascript" type="text/javascript" src="js/SlideItMoo.js"></script>
          <script language="javascript" type="text/javascript">
              window.addEvent('domready', function(){	
	             new SlideItMoo({itemsVisible:4, 
					      currentElement: 0, 
					      thumbsContainer: 'thumbs2',
					      elementScrolled: 'thumb_container2',
					      overallContainer: 'gallery_container2'});
              });
          </script>
     		<table class="default" colspan="10">
      <?php
     	 $server = $battlelog->ServerData($_GET["ServerID"]);
			   if ($server['message'] == "error"){
			   	echo '<td class="result" colspan="6"><b>'.LANG_GAMESERVER_ERROR.'</b></td><tr>';
			  }else{
			  		 $Queued = '';
			  if ($server['numQueued'] > 0){
			  	$Queued = ' ['.$server['numQueued'].']';
			  }
			  
			  $HCSETTING = $EoT->settings($server['preset']);
			  	?><td class="head" colspan="6" cellspacing="0">Server Details: <font class="DIVtext"><?php echo $server['name']; ?></font></td>
			  	  <tr>
			  	  	<td style="font-size:20px;" colspan="2"><span style="font-size:11px;"><?php echo  LANG_GAMESERVER_PLAYER; ?></span><br/><?php echo '<font class="DIVtext">'.$server['numPlayers'].'/'.$server['maxPlayers'].'</font>'.$Queued;?></td>
			  	  	<td style="font-size:20px;"><span style="font-size:11px;"><?php echo  LANG_GAMESERVER_RANKED; ?></span><br/><img src="<?php echo $domain; ?>/img/gameserver/icons/big/<?php echo Settings($server['ranked'],"rank") ; ?>.png" width="20px"/> <?php echo SettingsName($server['ranked']); ?></td>
			  	  	<td style="font-size:20px;"><span style="font-size:11px;"><?php echo  LANG_GAMESERVER_PB; ?></span><br/><img src="<?php echo $domain; ?>/img/gameserver/icons/big/<?php echo Settings($server['punkbuster'],"pb") ; ?>.png" width="20px"/> <?php echo SettingsName($server['punkbuster']); ?></td>
			  	  	<td style="font-size:20px;"><span style="font-size:11px;"><?php echo  LANG_GAMESERVER_SETTINGS; ?></span><br/><img src="<?php echo $domain; ?>/img/gameserver/icons/big/<?php echo Settings($HCSETTING,"hc") ; ?>.png" width="20px"/> <?php echo $EoT->settings($server['preset']); ?></td>
			  	  	<td style="font-size:20px;"><span style="font-size:11px;"><?php echo  LANG_GAMESERVER_PW; ?></span><br/><img src="<?php echo $domain; ?>/img/gameserver/icons/big/<?php echo Settings($server['passworded'],"pw") ; ?>.png" width="20px"/> <?php echo SettingsName($server['passworded']); ?></td>
			  	  <tr>
			  	  	<td class="result" colspan="6"><span style="font-size:12px;margin-left:10px;font-weight:bold;float:left;"><?php echo LANG_GAMESERVER_AKTIV_MAP; ?>: <font class="DIVtext"><?php echo $EoT->mapName($server['map']); ?></font></span>
			  	      <img src="<?php echo $domain; ?>/img/gameserver/maps/big/<?php echo $server['map']; ?>.jpg" style="border:3px solid #000"/>
			  	    <td>
			  	  <tr>
			  	  	<td class="result" colspan="2">
			  	  		 <span style="float:left"><?php echo LANG_GAMESERVER_SETTINGS1; ?></span><span style="float:right"><?php echo $EoT->region($server['region']); ?></span><br />
			  	  	   <span style="float:left"><?php echo LANG_GAMESERVER_SETTINGS2; ?></span><span style="float:right"><?php echo  SettingsServer($server['settings']['autobalance']); ?></span><br />
			  	  	   <span style="float:left"><?php echo LANG_GAMESERVER_SETTINGS3; ?></span><span style="float:right"><?php echo  $server['settings']['respawnTime']; ?></span><br />
			  	  	   <span style="float:left"><?php echo LANG_GAMESERVER_SETTINGS4; ?></span><span style="float:right"><?php echo  SettingsServer($server['settings']['killCam']); ?></span><br />
			  	  	   <span style="float:left"><?php echo LANG_GAMESERVER_SETTINGS5; ?></span><span style="float:right"><?php echo  $server['settings']['downTime']; ?></span><br />
			  	  	   <span style="float:left"><?php echo LANG_GAMESERVER_SETTINGS6; ?></span><span style="float:right"><?php echo  SettingsServer($server['settings']['squadLeaderSpawnOnly']); ?></span><br />
			  	  	   <span style="float:left"><?php echo LANG_GAMESERVER_SETTINGS7; ?></span><span style="float:right"><?php echo  $server['settings']['tksBeforeKick']; ?></span>
			  	  	</td>
			  	  	<td class="result" colspan="2">
			  	  		 <span style="float:left;margin-left:5px;"><?php echo LANG_GAMESERVER_SETTINGS8; ?></span><span style="float:right"><?php echo  SettingsServer($server['settings']['showHud']); ?></span><br />
			  	  	   <span style="float:left;margin-left:5px;"><?php echo LANG_GAMESERVER_SETTINGS9; ?></span><span style="float:right"><?php echo  $server['settings']['bulletDamage']; ?></span><br />
			  	  	   <span style="float:left;margin-left:5px;"><?php echo LANG_GAMESERVER_SETTINGS10; ?></span><span style="float:right"><?php echo  SettingsServer($server['settings']['vehicles']); ?></span><br />
			  	  	   <span style="float:left;margin-left:5px;"><?php echo LANG_GAMESERVER_SETTINGS11; ?></span><span style="float:right"><?php echo  SettingsServer($server['settings']['minimapSpotting']); ?></span><br />
			  	  	   <span style="float:left;margin-left:5px;"><?php echo LANG_GAMESERVER_SETTINGS12; ?></span><span style="float:right"><?php echo  SettingsServer($server['settings']['friendlyFire']); ?></span><br />
			  	  	   <span style="float:left;margin-left:5px;"><?php echo LANG_GAMESERVER_SETTINGS13; ?></span><span style="float:right"><?php echo  $server['settings']['idleKickSeconds']; ?></span><br />
			  	  	   <span style="float:left;margin-left:5px;"><?php echo LANG_GAMESERVER_SETTINGS14; ?></span><span style="float:right"><?php echo  SettingsServer($server['settings']['thirdPersonVehicleCam']); ?></span><br />
			  	  	</td>
			  	  	<td class="result" colspan="2">
			  	  		 <span style="float:left;margin-left:5px;"><?php echo LANG_GAMESERVER_SETTINGS15; ?></span><span style="float:right"><?php echo  SettingsServer($server['settings']['showEnemyNameTags']); ?></span><br />
			  	  	   <span style="float:left;margin-left:5px;"><?php echo LANG_GAMESERVER_SETTINGS16; ?></span><span style="float:right"><?php echo  SettingsServer($server['settings']['showMinimap']); ?></span><br />
			  	  	   <span style="float:left;margin-left:5px;"><?php echo LANG_GAMESERVER_SETTINGS17; ?></span><span style="float:right"><?php echo  SettingsServer($server['settings']['healthRegen']); ?></span><br />
			  	  	   <span style="float:left;margin-left:5px;"><?php echo LANG_GAMESERVER_SETTINGS18; ?></span><span style="float:right"><?php echo  $server['settings']['playerHealth']; ?></span><br />
			  	  	   <span style="float:left;margin-left:5px;"><?php echo LANG_GAMESERVER_SETTINGS19; ?></span><span style="float:right"><?php echo  SettingsServer($server['settings']['3dSpotting']); ?></span><br />
			  	  	   <span style="float:left;margin-left:5px;"><?php echo LANG_GAMESERVER_SETTINGS20; ?></span><span style="float:right"><?php echo  $server['settings']['kicksToBan']; ?></span><br />
			  	  	   <span style="float:left;margin-left:5px;"><?php echo LANG_GAMESERVER_SETTINGS21; ?></span><span style="float:right"><?php echo  $server['ip']; ?></span>
			  	  	</td>
			  	  <tr>
			  	   <td class="result" colspan="6"><span style="font-size:12px;margin-left:10px;font-weight:bold;float:left;"><?php echo LANG_MAPROTATION; ?></span>
						 <div id="gallery_container2">	
		          <div id="thumb_container2">			
			         <div id="thumbs2">
						      <?php if (is_array($server["mapRotation"])) foreach ($server["mapRotation"] as $Maps){ ?>
                     <div class="thumbnail">
                      <a rel="lightbox[galerie]"><img src="<?php echo $domain; ?>/img/gameserver/maps/<?php echo $Maps["name"]; ?>.jpg" width="180px" height="100px" /></a><?php echo $EoT->mapName($Maps["name"]).'<br/>'.$EoT->GameMode($Maps["mode"]); ?>
					           </div>
					 <?php } ?>
						   </div>			
		          </div>
	           </div>
				   </td>
				  <tr>
				  <td class="result" colspan="6"><span style="font-size:12px;margin-left:10px;font-weight:bold;float:left;"><?php echo LANG_GAMESERVER_PLAYERS; ?></span>
				  <tr>
				   <?php 
				   if ($server['numPlayers'] == 0) echo '<td colspan="6"><b>'.LANG_GAMESERVER_NNO_PLAYERS_FOUND.'</b></td>';
				     if (is_array($server["players"])){
				      $i = 0;
				       foreach ($server["players"] as $players){
				       	++$i;
				       	if (in_array($players["name"],$aPlayer)){
				       		$cPlayer = '<font class="DIVtext">'.TRIMUSERS($players["name"]).'</font>';
				       	}else{
				       		$cPlayer = TRIMUSERS($players["name"]);
				       	}
				       	?>
				       	<td colspan="1" style="font-size:12px;height:25px;font-style:bold;text-align:left">
				       		  <div>
				       		 	  <img style="border: 1px solid #008FC4;-moz-border-radius:5px 5px 5px 5px;-webkit-border-radius:5px 5px 5px 5px;border-radius:5px 5px 5px 5px;float:left;" src="http://www.gravatar.com/avatar/<?php echo $players['gravatar']; ?>?s=22&d=http%3A%2F%2Fbattlelog-cdn.battlefield.com%2Fpublic%2Fbase%2Fshared%2Fdefault-avatar-22.png%3Fv%3D7909" />
 	            	 	  </div>
 	            	 	  <div style="margin-top:3px;">	&nbsp;
				       		   <a href="http://battlelog.battlefield.com/bf3/de/user/<?php echo rawurlencode($players["name"]); ?>" target="_blank"><?php echo $cPlayer; ?></a>
				       		  </div>
				       		</td>
				       	<?php	
			  	  		if ($i % 6 == 0) echo'<tr />';
			  	      
			  	 }		  	
			  echo '</td>';
			 }
			 echo '</table>';
    }
   }  
     
     
     
     
          
  include_once 'inc/footer.php'; 
    
    echo '</div>';
    
    
 function Settings($data,$icon){
  if ($data == "1" OR $data == "true" OR $data == "Hardcore"){
  	 $return = $icon;
  	}else{
  		$return = $icon.'_no';
  	}
  return $return;
  }
  
  function SettingsName($data){
  if ($data == "1" OR $data == "true" OR $data == "Hardcore"){
  	 $return = LANG_GAMESERVER_YES;
  	}else{
  		$return = LANG_GAMESERVER_NO1;
  	}
  return $return;
  }
  
  function SettingsServer($data){
  if ($data == "1" OR $data == "true"){
  	 $return = LANG_GAMESERVER_YES1;
  	}else{
  		$return = LANG_GAMESERVER_NO2;
  	}
  return $return;
  }
  
  
  
  
  function TRIMNAME ($name) {
      if(strlen($name) <= 50) {
          $result = htmlspecialchars($name);
        }else{
          $result = htmlspecialchars(substr($name,0,48) . '.....'); 
        } 
     return $result;
  }  
  
  function TRIMUSERS ($name) {
      if(strlen($name) <= 11) {
          $result = htmlspecialchars($name);
        }else{
          $result = htmlspecialchars(substr($name,0,9) . '..'); 
        } 
     return $result;
  }  
  
  
  		?>
  		 <script type="text/javascript">
		$(document).ready(function() {
	
			$("a#bf3stats").fancybox({
			'autoDimensions'	: true,
			'transitionIn'		: 'none',
			'transitionOut'		: 'none',
			'padding' : 0,
      'overlayColor'		: '#000',
			'overlayOpacity'	: 0.8
	   });
   });
	</script>