/**
 * Guildleves NextDeploymentDateTime Calc BlogParts
 *
 * @package    Site
 * @author     Takayuki HIROSAWA <t-hirosawa@speed-fish.com>
 * @illust     Ohka.
 * @copyright  2010/10/03 gamerstreet.jp
 * @since      1.0, 2010/10/03
 * @lastupdate 1.05, 2010/12/22
 */

/*
Guildleves NextDeploymentDateTime Calc BlogParts
Copyright (C) 2010/10/03 gamerstreet.jp
Illustlated by Ohka.

This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
*/

var $ukey = ""+Math.floor( Math.random() * 1000000 );if (typeof levetimerid == 'undefined' ) {	levetimerid = new Array();}function makeTemplate() {$nowdate = new Date();$month = $nowdate.getMonth()+1;$date = $nowdate.getDate();$hallow_pics = new Array();$hallow_pics[0] = "http://www.gamerstreet.jp/bp/nextleveskin_hallow01.png";$hallow_pics[1] = "http://www.gamerstreet.jp/bp/nextleveskin_hallow02.png";$hallow_pics[2] = "http://www.gamerstreet.jp/bp/nextleveskin_hallow03.png";$beforexmas_pics = "http://www.gamerstreet.jp/bp/nextleveskin_before_xmas.png";$xmas_pics = "http://www.gamerstreet.jp/bp/nextleveskin_xmas.png";$afterxmas_pics = "http://www.gamerstreet.jp/bp/nextleveskin_after_xmas.png";$skin = "http://www.gamerstreet.jp/bp/nextlevesskin001.png";if (($month == 10) && ($date >= 20 && $date <= 31)) {$skin = $hallow_pics[Math.floor(Math.random() * 3)];}if (($month == 12) && ($date >= 20 && $date <= 23)) {$skin = $beforexmas_pics;}if (($month == 12) && ($date >= 24 && $date <= 25)) {$skin = $xmas_pics;}if (($month == 12) && ($date >= 26 && $date <= 26)) {$skin = $afterxmas_pics;}var $pre = "<div style=\"position:relative; width:160px; height:220px; background:url(" + $skin + ");\"><div id=\"NextlevesDateTime" + $ukey + "\" name=\"NextlevesDateTime\" style=\"position:absolute; top:145px; left:6px; width:146px; font-size:14px;font-family:arial,Verdana;font-weight:bold;color:#000000;line-height:100%;letter-spacing:0.1px;\"><center>";var $after = "</center></div><a href=\"http://www.gamerstreet.jp/onlinegame/ff14\" target=\"_blank\" style=\"position:absolute; top:193px; width:160px; height:27px; display:block;\"></a></div>";return $pre + $after;}function getNextlevesDateTime() {var $levesIntervalHour = 36;var $levesIntervalMilSeconds = $levesIntervalHour * 3600000;var $levesStartDatetime = new Date("2010/09/22 9:00:00");var $levesStartDatetimeMS = (+new Date("2010/09/22 9:00:00"));var $NowDatetime = (new Date());var $NowDatetimeMS = (+new Date());$diff = ($NowDatetimeMS - $levesStartDatetimeMS );$NextDiff = Math.floor($diff / $levesIntervalMilSeconds);$Next = (($NextDiff * $levesIntervalMilSeconds) + $levesIntervalMilSeconds) / 3600000;$getBaseHour = $levesStartDatetime.getHours();$NextDateTime = $levesStartDatetime;$NextDateTime.setHours($getBaseHour + $Next);$DiffDateTime = $NextDateTime - $NowDatetimeMS;$DiffHours = Math.floor($DiffDateTime / 3600000);$DiffMinutes = Math.ceil(($DiffDateTime % 3600000) / 60000);return ($NextDateTime.getFullYear() + "/" + ("0"+($NextDateTime.getMonth()+1)).slice(-2) + "/" + ("0"+($NextDateTime.getDate())).slice(-2) + "<br/>" + ("0"+($NextDateTime.getHours())).slice(-2) + ":" + ("0"+($NextDateTime.getMinutes())).slice(-2) + "<br/>to " +  ("0"+($DiffHours)).slice(-2) + " hours " + ("0"+($DiffMinutes)).slice(-2) + " min.");}function rewriteNextDateObject($keys){var $v = getNextlevesDateTime();document.getElementById("NextlevesDateTime" + $keys ).innerHTML = "<center>" + $v + "</center>";}document.write(makeTemplate());rewriteNextDateObject($ukey);levetimerid[$ukey] = setInterval("rewriteNextDateObject($ukey)",10000);

