
// Flash Navi.
function wizmansmenu(menu) {
	if (menu.toString() == "1") {
		window.open("/rebirth/wizmans/monster/list.html");
	}else if (menu.toString() == "2") {
		f_openBoardPopup("/rebirth/wizmans/topimage/", "info");
	}else if (menu.toString() == "3") {
		f_openBoardPopup("/rebirth/wizmans/logo/", "info");
	}else if (menu.toString() == "4") {
		window.open("http://blog.livedoor.jp/jaleco1/archives/cat_64409.html");
	}else if (menu.toString() == "5") {
		window.open("http://blog.livedoor.jp/jaleco2/archives/cat_36778.html");
	}
}

// Top Page Navi. Callback
var M2 = new Object();
M2.timerID = 0;
M2.BoardDisplay = function() {
	M2.timerID = window.setTimeout('M2.BoardShow()',700);
}
M2.BoardShow = function() {
	var layer = document.getElementById('history_layer');
	layer.style.display = "block";
}
M2.BoardHide = function() {
	if (M2.timerID > 0) window.clearTimeout(M2.timerID);
	var layer = document.getElementById('history_layer');
	layer.style.display = "none";
}
function Board() {
	M2.BoardHide();
}


// Init Popup
var BoardPopupInfo = {
	info	: ['Layer',502,490],
	guide	: ['Window',530,700],
	list	: ['Window',900,700],
	write	: ['Window',570,700],
	modify	: ['Window',570,530],
	thread	: ['Window',900,700],
	history	: ['Window',900,700]
};
var ThisPopupMode = null;
function f_openBoardPopup(url, mode) {
	if (BoardPopupInfo[mode][0] == 'Layer') {
		layerWin.open(url, BoardPopupInfo[mode][1], BoardPopupInfo[mode][2], true, false);
	}else{
		top.window.open( url, "BoardPopup", "width="+BoardPopupInfo[mode][1].toString()+",height="+BoardPopupInfo[mode][2].toString()+",resizable=0,scrollbars=1,menubar=0,location=0,status=0,directories=0,toolbar=0" );
		//if (parent && parent.LPlib) parent.LPlib.close();
	}
}
function f_initPopupPage(mode) {
	ThisPopupMode = mode;
	if ((BoardPopupInfo[mode][0] == 'Layer') && parent && parent.LPlib) {
		parent.LPlib.setSize(BoardPopupInfo[mode][1], BoardPopupInfo[mode][2]);
		if (parent.LPlib.getCurrentObject()) parent.LPlib.getCurrentObject().adjustScrolling();
		parent.LPlib.closeLoadingMask();
		f_addEvent (self.window, "onunload", parent.LPlib.showLoadingMask, false);
	}else{
		f_adjustPopupSize(BoardPopupInfo[mode][1], BoardPopupInfo[mode][2]);
		self.focus();
	}
}
function f_adjustPopupSize(width,height) {
	top.resizeBy(width-top.LPlib.browserSize().width, 0);
	top.resizeBy(0, height-top.LPlib.browserSize().height);
}

function closePopupPage() {
	if (parent) {
		if (parent.LPlib) {
			var objLP = parent.LPlib.getCurrentObject();
			if (objLP) {
				parent.LPlib.close();
				return;
			}
		}
		top.close();
	}
}

// Check Writable
function checkTopImageWritable() {
	alert('恐れ入りますが、「WiZmans World」公式サイトトップ画像応募は、\n2009年12月31日（木）17時を持ちまして受付を終了いたしました。\n\n多数のご応援ありがとうございます。');
	return false;
}
function checkTitleLogoWritable() {
	alert('恐れ入りますが、「WiZmans World」タイトルロゴデザイン応募は、\n2009年8月16日（日）17時を持ちまして受付を終了いたしました。\n\n多数のご応援ありがとうございます。');
	return false;
}

// Recommend
function f_topimage_recommend(id) {
	alert('現在、投票可能時間ではありません。');
	return false;
}
function f_titlelogo_recommend(id) {
	alert('現在、投票可能時間ではありません。');
	return false;
}
function callbackRecommend(xmlHttp) {
	if (xmlHttp && xmlHttp.responseXML) {
		var root		= xmlHttp.responseXML.documentElement;
		var objCount	= root.getElementsByTagName('recommendcount');
		var objMsg	= root.getElementsByTagName('msg');
		if ((objCount.length > 0) && (document.getElementById('DIV_RECOMMEND_COUNT')))
			document.getElementById('DIV_RECOMMEND_COUNT').innerHTML = objCount[0].firstChild.nodeValue;
		if (objMsg.length > 0) alert(objMsg[0].firstChild.nodeValue.replace(/\\n/gi,'\n'));
		xmlHttp = root = null;
	}
	return;
}

function showErrorMsg(msg) {
	if ( document.getElementById('DIV_ERROR_MSG') && document.getElementById('TXT_ERROR_MSG')) {
		document.getElementById('TXT_ERROR_MSG').innerHTML = msg;
		document.getElementById('DIV_ERROR_MSG').style.display = 'block';
	}
}

function closeErrorMsg() {
	if ( document.getElementById('DIV_ERROR_MSG') && document.getElementById('TXT_ERROR_MSG')) {
		document.getElementById('TXT_ERROR_MSG').innerHTML = '';
		document.getElementById('DIV_ERROR_MSG').style.display = 'none';
	}
}

// Flash Embed
function f_writeFlashTags(id,src,width,height,wmode,bgcolor) {
	var requiredMajorVersion = 9;
	var requiredMinorVersion = 0;
	var requiredRevision = 124;
	var hasProductInstall = DetectFlashVer(6, 0, 65);
	var hasRequestedVersion = DetectFlashVer(requiredMajorVersion, requiredMinorVersion, requiredRevision);
	if ( hasProductInstall && !hasRequestedVersion ) {
		var MMPlayerType = (isIE == true) ? "ActiveX" : "PlugIn";
		var MMredirectURL = window.location;
		document.title = document.title.slice(0, 47) + " - Flash Player Installation";
		var MMdoctitle = document.title;
		AC_FL_RunContent(
			"src", "/rebirth/swf/playerProductInstall",
			"FlashVars", "MMredirectURL="+MMredirectURL+'&MMplayerType='+MMPlayerType+'&MMdoctitle='+MMdoctitle+"",
			"width", width,
			"height", height,
			"align", "middle",
			"id", id,
			"quality", "high",
			"bgcolor", bgcolor,
			"wmode", wmode,
			"name", id,
			"allowScriptAccess","sameDomain",
			"type", "application/x-shockwave-flash",
			"pluginspage", "http://www.adobe.com/go/getflashplayer"
		);
	} else if (hasRequestedVersion) {
		AC_FL_RunContent(
		"src", src,
		"width", width,
		"height", height,
		"align", "middle",
		"id", id,
		"quality", "high",
		"bgcolor", bgcolor,
		"wmode", wmode,
		"name", id,
		"allowScriptAccess","sameDomain",
		"type", "application/x-shockwave-flash",
		"pluginspage", "http://www.adobe.com/go/getflashplayer"
		);
	} else {
		var alternateContent = 'Alternate HTML content should be placed here. '
		+ 'This content requires the Adobe Flash Player. '
		+ '<a href=http://www.adobe.com/go/getflash/>Get Flash</a>';
		document.write(alternateContent);
	}
}


