imgPATH = "images\/";

imgArray = new Array();
imgArray[0] = imgPATH + "neco.wink.1.gif";
imgArray[1] = imgPATH + "neco.wink.2.gif";

var timerID;
var openpage;

var tim = 300;

function openingAccess() {
	new Image().src = "images/dia.top.gif";
	new Image().src = "images/dia.access.gif";
	new Image().src = "images/dia.party.gif";
	new Image().src = "images/dia.event.gif";
	new Image().src = "images/dia.gallery.gif";
	new Image().src = "images/dia.link.gif";

	$("container").style.display = "block";
	openpage = "access";
}

function openingComment() {
	$("container").style.display = "block";
	openpage = "comment";
}

function openingEvent() {
	new Image().src = "images/dm.large.gif";
	new Image().src = "images/event.08.12.1.gif";
	new Image().src = "images/dm.red.gif";
	new Image().src = "images/dm.white.gif";
	new Image().src = "images/event.08.12.2.gif";
	new Image().src = "images/dia.top.gif";
	new Image().src = "images/dia.access.gif";
	new Image().src = "images/dia.party.gif";
	new Image().src = "images/dia.event.gif";
	new Image().src = "images/dia.gallery.gif";
	new Image().src = "images/dia.link.gif";

	$("container").style.display = "block";
	openpage = "event";
}

pMax_array = new Array(0, 93, 46, 40, 70, 6);
ct_array   = new Array(0, 24, 12, 10, 18, 2);
var galleryMax = 5;

function openingGallery() {
	new Image().src = "images/dia.top.gif";
	new Image().src = "images/dia.access.gif";
	new Image().src = "images/dia.party.gif";
	new Image().src = "images/dia.event.gif";
	new Image().src = "images/dia.gallery.gif";
	new Image().src = "images/dia.link.gif";
/*
	for (m = 1; m <= galleryMax; m++) {
		pMax = pMax_array[m];
		for (n = 1; n <= pMax; n++) {
			src  = "photo/photo" + m + "/photo";
			srct = "photo/photot" + m + "/photo";

			if (n < 10) {
				new Image().src = src + "00" + n + ".jpg";
				new Image().src = srct + "00" + n + ".jpg";
			}
			else if (n < 100) {
				new Image().src = src + "0" + n + ".jpg";
				new Image().src = srct + "0" + n + ".jpg";
			}
			else {
				new Image().src = src + n + ".jpg";
				new Image().src = srct + n + ".jpg";
			}
		}
	}
*/
	cl = 1;
	ct = ct_array[galleryMax];
	cd = 5;
	rt = 4;
	pMax = pMax_array[galleryMax];

	$("lbtn").style.visibility = "hidden";
	$("rbtn").style.visibility = "hidden";

	page = galleryMax;		// 初期値

	cursorSet(galleryMax);
/*
	$("gallery21").style.cursor = "pointer";
	$("gallery22").style.cursor = "pointer";
	$("gallery23").style.cursor = "pointer";
	$("gallery24").style.cursor = "default";
*/

	$("container").style.display = "block";
	openpage = "gallery";
}

function openingIndex() {
	new Image().src = imgArray[0];
	new Image().src = imgArray[1];

	new Image().src = "images/top.background.gif";
	new Image().src = "images/logo.gif";
	new Image().src = "images/top.gif";
	new Image().src = "images/access.gif";
	new Image().src = "images/party.gif";
	new Image().src = "images/event.gif";
	new Image().src = "images/gallery.gif";
	new Image().src = "images/link.gif";
	new Image().src = "images/info.gif";
	new Image().src = "images/house.of.neco.gif";
	new Image().src = "images/update.gif";
	new Image().src = "images/dia.top.gif";
	new Image().src = "images/dia.access.gif";
	new Image().src = "images/dia.party.gif";
	new Image().src = "images/dia.event.gif";
	new Image().src = "images/dia.gallery.gif";
	new Image().src = "images/dia.link.gif";

	openpage = "index";

	var url = document.referrer;
	var n = url.indexOf("nightcafe-neco.com");
	if (n == -1) {
		$("body1").style.backgroundColor="#ffffff";
		$("containerNeco").style.display = "block";
		clearTimeout(timerID);
		timerID = setTimeout("opening1()", tim);
	}
	else {
		opening3();
	}
}

function openingLink() {
	new Image().src = "images/dia.top.gif";
	new Image().src = "images/dia.access.gif";
	new Image().src = "images/dia.party.gif";
	new Image().src = "images/dia.event.gif";
	new Image().src = "images/dia.gallery.gif";
	new Image().src = "images/dia.link.gif";

//	$("body1").style.backgroundColor="#000000";
	$("container").style.display = "block";
	openpage = "link";
}

function openingParty() {
	new Image().src = "images/dia.top.gif";
	new Image().src = "images/dia.access.gif";
	new Image().src = "images/dia.party.gif";
	new Image().src = "images/dia.event.gif";
	new Image().src = "images/dia.gallery.gif";
	new Image().src = "images/dia.link.gif";

	$("container").style.display = "block";
	openpage = "party";
}

function openingTop() {
}

function opening1() {
	clearTimeout(timerID);
	$("neco").setAttribute("src", imgArray[1]);
	timerID = setTimeout("opening2()", 250);
}
function opening2() {
	clearTimeout(timerID);
	$("neco").setAttribute("src", imgArray[0]);
	new Effect.Fade("neco", {afterFinish:opening3});
//	timerID = setTimeout("opening3()", 100);
}
function opening3() {
	clearTimeout(timerID);
	$("body1").style.backgroundColor="#000000";
	$("containerNeco").style.display = "none";
	$("container").style.display = "block";
//	location.href = "top.html";
}


srcMenu = new Array("access.gif", "party.gif", "event.gif", "comment.gif", "link.gif", "top.gif");
srcMenu2 = new Array("dia.access.gif", "dia.party.gif", "dia.event.gif", "dia.gallery.gif", "dia.link.gif", "dia.top.gif");

function mouseOver(n) {
	tagID = "menu" + n;
	textMenu = imgPATH + srcMenu2[n];
	$(tagID).setAttribute("src", textMenu);
}

function mouseOut(n) {
	tagID = "menu" + n;
	textMenu = imgPATH + srcMenu[n];
	$(tagID).setAttribute("src", textMenu);
}

/*******************************************************************************/
/*
function eventChange(p) {
	srcEvent   = new Array("", "", "", "", "",                 "", "", "", "", "", "", "");
	leftEvent  = new Array(55, 55, 55, 55,  55,                55, 55, 55, 55, 55, 55, 55);
	topEvent   = new Array(15, 15, 15, 15,  15,                15, 15, 15, 15, 15, 15, 15);
	src2Event  = new Array("", "", "", "", "event.20100515.s", "", "", "", "", "", "", "");
	left2Event = new Array( 0,  0,  0,  0, 280,                 0,  0,  0,  0,  0,  0,  0);
	topE2vent  = new Array( 0,  0,  0,  0,  10,                 0,  0,  0,  0,  0,  0,  0);
	hrefEvent  = new Array("", "", "", "", "event.20100515.l", "", "", "", "", "", "", "");
	flagEvent  = new Array( 1,  1,  1,  1,   3,                 1,  1,  1,  3,  3,  1,  3);	// 0･･･ / 1･･･text only / 2･･･text & photo / 3･･･text & photo & link

	textEvent  = new Array(
"<span style='font-size:17px; line-height:24px;'>2010.07.03 (sat)<br></span><span style='font-size:30px; line-height:34px;'>ドキドキ時.３<br></span><span style='font-size:6px; line-height:8px;'>&nbsp;<br></span><span style='font-size:18px; line-height:20px;'>START／22:00〜<br></span><span style='font-size:15px; line-height:17px;'>adv&nbsp;&nbsp;1,500yen（drink別）<br></span><span style='font-size:15px; line-height:17px;'>door&nbsp;1,800yen（drink別）<br></span><span style='font-size:6px; line-height:8px;'>&nbsp;<br></span><span style='font-size:16px; line-height:18px;'>DJ&prime;s<br>&nbsp;&nbsp;kusaregame, 西広志（shuri）<br></span><span style='font-size:16px; line-height:19px;'>&nbsp;&nbsp;古田誠一（synchronicity）<br></span><span style='font-size:16px; line-height:16px;'>&nbsp;&nbsp;zaramander, sase<br></span><span style='font-size:6px; line-height:10px;'>&nbsp;<br></span><span style='font-size:16px; line-height:18px;'>踊り子<br>&nbsp;&nbsp;SHAKA $ SHAKA<br></span><span style='font-size:6px; line-height:10px;'>&nbsp;<br></span><span style='font-size:15px; line-height:17px; color:#00ffff;'>※先着30名様に光るオモチャあげるよ!!<br></span>",

"<span style='font-size:17px; line-height:24px;'>2010.07.10 (sat)<br></span><span style='font-size:30px; line-height:34px;'>大人の歌謡祭<br></span><span style='font-size:6px; line-height:8px;'>&nbsp;<br></span><span style='font-size:18px; line-height:20px;'>START／21:00〜<br></span><span style='font-size:15px; line-height:17px;'>1,500yen（w／1drink）<br></span><span style='font-size:2px; line-height:8px;'>&nbsp;<br></span><span style='font-size:16px; line-height:18px;'>DJ&prime;s<br>&nbsp;&nbsp;SHIRANE, ピンポン<br>&nbsp;&nbsp;シモカド☆イサム（男の星座）<br>&nbsp;&nbsp;SOEJIMA（dynamo）<br>&nbsp;&nbsp;Kawano（neco）<br></span>",

"<span style='font-size:17px; line-height:24px;'>2010.07.17 (sat)<br></span><span style='font-size:30px; line-height:34px;'>Sandwich </span><span style='font-size:18px; line-height:34px;'>vol.26<br></span><span style='font-size:6px; line-height:8px;'>&nbsp;<br></span><span style='font-size:18px; line-height:20px;'>START／22:00〜<br></span><span style='font-size:15px; line-height:17px;'>Adv.&nbsp;&nbsp;1,500yen（1d + Sandwich CD）<br></span><span style='font-size:15px; line-height:17px;'>Door.&nbsp;2,000yen（1d）<br></span><span style='font-size:2px; line-height:8px;'>&nbsp;<br></span><span style='font-size:16px; line-height:18px;'>Irregular DJ<br>&nbsp;&nbsp;川瀬健誠（from FUKUOKA）<br></span><span style='font-size:2px; line-height:8px;'>&nbsp;<br></span><span style='font-size:16px; line-height:18px;'>Regular DJ<br>&nbsp;&nbsp;中村隆博（RE:CREATION）<br>&nbsp;&nbsp;村田俊介<br>&nbsp;&nbsp;KAZAHAYA<br>&nbsp;&nbsp;TOMOYA<br></span>",

"<span style='font-size:17px; line-height:24px;'>2010.07.17 (sat)<br></span><span style='font-size:30px; line-height:34px;'>Cafe Plastico<br></span><span style='font-size:6px; line-height:6px;'>&nbsp;<br></span><span style='font-size:18px; line-height:20px;'>START／22:00〜<br></span><span style='font-size:16px; line-height:18px;'>1,500yen (1drink)<br></span><span style='font-size:2px; line-height:2px;'>&nbsp;<br></span><span style='font-size:16px; line-height:18px;'>house／techno<br></span><span style='font-size:6px; line-height:6px;'>&nbsp;<br></span><span style='font-size:16px; line-height:18px;'>DJ&nbsp;&nbsp;a.k.i., Daishi, Hysamoto, Moto<br></span>",

"<span style='font-size:17px; line-height:24px;'>2010.05.14 (fri)<br></span><span style='font-size:30px; line-height:34px;'>Starlight<br></span><span style='font-size:6px; line-height:6px;'>&nbsp;<br></span><span style='font-size:18px; line-height:20px;'>START／21:00〜<br></span><span style='font-size:16px; line-height:18px;'>1,000yen (1drink)<br></span><span style='font-size:2px; line-height:2px;'>&nbsp;<br></span><span style='font-size:16px; line-height:18px;'>house／lounge<br></span>",

"<span style='font-size:17px; line-height:24px;'>2010.05.15 (sat)<br></span><span style='font-size:30px; line-height:34px;'>ON-ANY<br></span><span style='font-size:4px; line-height:4px;'>&nbsp;<br></span><span style='font-size:18px; line-height:20px;'>START／21:00〜<br></span><span style='font-size:16px; line-height:18px;'>With flier 1,500yen<br></span><span style='font-size:2px; line-height:2px;'>&nbsp;<br></span><span style='font-size:16px; line-height:18px;'>DJ&nbsp;&nbsp;Daisuke, Takatoshi<br>Djembe Nhapackatt Wvanchaoies<br></span>",

"<span style='font-size:17px; line-height:24px;'>2010.05.21 (fri)<br></span><span style='font-size:30px; line-height:34px;'>Gentle Planet<br></span><span style='font-size:6px; line-height:6px;'>&nbsp;<br></span><span style='font-size:18px; line-height:20px;'>START／21:00〜<br></span><span style='font-size:16px; line-height:18px;'>1,000yen (1drink)<br></span><span style='font-size:2px; line-height:2px;'>&nbsp;<br></span><span style='font-size:16px; line-height:18px;'>house／lounge<br></span><span style='font-size:6px; line-height:6px;'>&nbsp;<br></span><span style='font-size:16px; line-height:18px;'>DJ&nbsp;&nbsp;Hysa, Kawano<br></span>",

"<span style='font-size:17px; line-height:24px;'>2010.05.28 (fri)<br></span><span style='font-size:30px; line-height:34px;'>House Jazz Lounge<br></span><span style='font-size:6px; line-height:6px;'>&nbsp;<br></span><span style='font-size:18px; line-height:20px;'>START／21:00〜<br></span><span style='font-size:16px; line-height:18px;'>1,000yen (1drink)<br></span><span style='font-size:2px; line-height:2px;'>&nbsp;<br></span><span style='font-size:16px; line-height:18px;'>house／jazz／etc<br></span><span style='font-size:4px; line-height:4px;'>&nbsp;<br></span><span style='font-size:16px; line-height:18px;'>DJ&nbsp;&nbsp;Tomoya<br></span>",

"<span style='font-size:17px; line-height:24px;'>2010.05.29 (sun)<br></span><span style='font-size:28px; line-height:30px;'>タイトル未定<br></span><span style='font-size:6px; line-height:6px;'>&nbsp;<br></span><span style='font-size:18px; line-height:20px;'>START／21:00〜<br></span><span style='font-size:6px; line-height:6px;'>&nbsp;<br></span><span style='font-size:16px; line-height:18px;'>soul／good music<br></span>",

"<span style='font-size:17px; line-height:24px;'>2010.04.10 (sat)<br></span><span style='font-size:30px; line-height:30px;'>Sandwich</span><span style='font-size:18px; line-height:20px;'>&nbsp;&nbsp;4th anniversary party<br></span><span style='font-size:24px; line-height:24px;'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;×<br></span><span style='font-size:30px; line-height:30px;'>MINOTAUR<br></span><span style='font-size:6px; line-height:6px;'>&nbsp;<br></span><span style='font-size:18px; line-height:20px;'>START／22:00〜<br></span><span style='font-size:2px; line-height:2px;'>&nbsp;<br></span><span style='font-size:14px; line-height:16px;'>Adv.&nbsp;&nbsp;2,000yen (1d + Sandwich CD)<br></span><span style='font-size:14px; line-height:16px;'>Door.&nbsp;2,500yen (1d)<br></span><span style='font-size:6px; line-height:6px;'>&nbsp;<br></span><span style='font-size:16px; line-height:18px;'>Special Guest DJ<br></span><span style='font-size:16px; line-height:18px;'>&nbsp;&nbsp;&nbsp;&nbsp;Eiichi Izumi (MINOTAUR)<br></span>",

"<span style='font-size:17px; line-height:24px;'>2010.04.24 (sat)<br></span><span style='font-size:30px; line-height:34px;'>Key&prime;s Room<br></span><span style='font-size:6px; line-height:6px;'>&nbsp;<br></span><span style='font-size:18px; line-height:20px;'>START／21:00〜<br></span><span style='font-size:16px; line-height:18px;'>2,000yen (1drink)<br></span><span style='font-size:6px; line-height:6px;'>&nbsp;<br></span><span style='font-size:16px; line-height:18px;'>DJ&nbsp;&nbsp;KEY<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;JUICE<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;YUTAKA<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;HC<br>Guest&nbsp;&nbsp;Kawano<br></span><span style='font-size:6px; line-height:6px;'>&nbsp;<br></span><span style='font-size:14px; line-height:16px;'>All Party Music<br>&nbsp;&nbsp;(R&amp;B, House, HipHop, and more…)<br></span>",

"<span style='font-size:17px; line-height:24px;'>2010.04.28 (wed)<br></span><span style='font-size:30px; line-height:34px;'>Girl&prime;s Night<br></span><span style='font-size:10px; line-height:20px;'>&nbsp;&nbsp;〜</span><span style='font-size:20px; line-height:20px;'>Secret Room</span><span style='font-size:10px; line-height:20px;'>〜<br></span><span style='font-size:4px; line-height:4px;'>&nbsp;<br></span><span style='font-size:18px; line-height:20px;'>START／21:00〜 (girl&prime;s)<br></span><span style='font-size:18px; line-height:20px;'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;24:00〜 (men&prime;s)<br></span><span style='font-size:16px; line-height:18px;'>2,000yen (1drink)<br></span><span style='font-size:2px; line-height:2px;'>&nbsp;<br></span><span style='font-size:16px; line-height:18px; color:#ff1493'>Dress Code&nbsp;&nbsp;pink<br></span>",

"");

	switch (flagEvent[p]) {
		case 1:
			txt = "<div id='eventp'>";
			txt += textEvent[p];
			txt += "</div>";
			break;

		case 3:
			txt = "<div id='eventp'>";
			txt += textEvent[p];
			txt += "</div>";
			txt += "<a id='evanta2' href='images/";
			txt += hrefEvent[p];
			txt += ".jpg' rel='lightbox' target='_blank'><img id='eventp2' src='images/";
			txt += src2Event[p];
			txt += ".jpg'></a>";
			break;

		default:
			if (src2Event[p] == "") {
				if (hrefEvent[p] == "") {	//<eventp>
					txt = "<img id='eventp' src='images/";
					txt += srcEvent[p];
					txt += ".jpg'>";
				}
				else {										//<eventa><eventp>
					txt = "<a id='eventa2' href='images/";
					txt += hrefEvent[p];
					txt += ".jpg' rel='lightbox' target='_blank'><img id='eventp' src='images/";
					txt += srcEvent[p];
					txt += ".jpg'></a>";
				}
			}
			else {
				if (hrefEvent[p] == "") {	//<eventp><eventp2>
					txt = "<img id='eventp' src='images/";
					txt += srcEvent[p];
					txt += ".jpg'>";
					txt += "<img id='eventp2' src='images/";
					txt += src2Event[p];
					txt += ".jpg'>";
				}
				else {										//<eventa><eventp><eventa2><eventp2>
					txt = "<a id='eventa' href='images/";
					txt += hrefEvent[p];
					txt += ".jpg' rel='lightbox' target='_blank'><img id='eventp' src='images/";
					txt += srcEvent[p];
					txt += ".jpg'></a>";
					txt += "<a id='eventa2' href='images/";
					txt += hrefEvent[p];
					txt += ".jpg' rel='lightbox' target='_blank'><img id='eventp2' src='images/";
					txt += src2Event[p];
					txt += ".jpg'></a>";
				}
			}
			break;
	}

	$("event2").innerHTML = txt;

	if (src2Event[p] != "") {
		$("eventp2").style.left = left2Event[p] + "px";
		$("eventp2").style.top  = topE2vent[p]  + "px";
	}

	$("eventp").style.left = leftEvent[p] + "px";
	$("eventp").style.top  = topEvent[p]  + "px";

	if (flagEvent[p] <= 3) {
		$("eventp").style.color = "#ffffff";
		$("eventp").style.fontFamily = "'Times New Roman', 'ＭＳ Ｐ明朝'";
	}
}
*/

function scrll() {
	if (cl + cd <= ct) {		// 左スクロール可能
		cl += cd;
		scroll();
	}

	btndsp();
}

function scrlr() {
	if (cl > 1) {		// 右スクロール可能
		cl -= cd;
		scroll();
	}

	btndsp();
}

function btndsp() {
	if (cl + cd <= ct) {
		$("rbtn").style.visibility = "visible";
	}
	else {
		$("rbtn").style.visibility = "hidden";
	}

	if (cl > 1) {
		$("lbtn").style.visibility = "visible";
	}
	else {
		$("lbtn").style.visibility = "hidden";
	}
}


function scroll() {
	txt = "<table cellspacing='5'>";

	for (m = 0; m < rt; m++) {
		txt += "<tr>";

		for (n = 0; n < cd; n++) {
			tag = (cl - 1) * rt + 1 + m + n * rt;
			if (tag < 10) {
				tag = "00" + tag;
			}
			else if (tag < 100) {
				tag = "0" + tag;
			}

			tag2 = 1 + m + n * rt;
			photoj = page + "/photo" + tag + ".jpg";

			if (tag <= pMax) {
				txt += "<td align='center' valign='middle'><a id='photoa";
				txt += tag2;
				txt += "' href='photo/photo";
				txt += photoj;
				txt += "' rel='lightbox[g1]' target='_blank'><img id='photoi";
				txt += tag2;
				txt += "' src='photo/photot";
				txt += photoj;
				txt += "'></a></td>";
			}
			else {
				break;
			}
		}

		txt += "</tr>";
	}

	txt += "</table>";

	$("photo").innerHTML = txt;
}


galleryContents = new Array("",
														"2008.12.12&nbsp;&nbsp;House of neco&nbsp;&nbsp;Merry merry X'mas SHOW&nbsp;&nbsp;at Mars (part1)",
														"2008.12.12&nbsp;&nbsp;House of neco&nbsp;&nbsp;Merry merry X'mas SHOW&nbsp;&nbsp;at Mars (part2)",
														"2008.12.20&nbsp;&nbsp;Key's Room&nbsp;&nbsp;at night cafe neco",
														"2008.12.31&nbsp;&nbsp;count down party&nbsp;&nbsp;at night cafe neco",
														"2009.01.24&nbsp;&nbsp;mid &amp; half&nbsp;&nbsp;at night cafe neco"
														);

function photoChange(p) {
	if (page == p) {
		return;
	}

	if (p == 5) {
		txt = "<table cellspacing='5'><tr>";
		txt += "<td align='center' valign='middle'><a id='photoa1' href='photo/photo5/photo001.jpg' rel='lightbox[g1]' target='_blank'><img id='photoi1' src='photo/photot5/photo001.jpg'></a></td>";
		txt += "<td align='center' valign='middle'><a id='photoa2' href='photo/photo5/photo002.jpg' rel='lightbox[g1]' target='_blank'><img id='photoi2' src='photo/photot5/photo002.jpg'></a></td>";
		txt += "<td align='center' valign='middle'><a id='photoa3' href='photo/photo5/photo003.jpg' rel='lightbox[g1]' target='_blank'><img id='photoi3' src='photo/photot5/photo003.jpg'></a></td>";
		txt += "<td align='center' valign='middle'><a id='photoa4' href='photo/photo5/photo004.jpg' rel='lightbox[g1]' target='_blank'><img id='photoi4' src='photo/photot5/photo004.jpg'></a></td>";
		txt += "<td align='center' valign='middle'><a id='photoa5' href='photo/photo5/photo005.jpg' rel='lightbox[g1]' target='_blank'><img id='photoi5' src='photo/photot5/photo005.jpg'></a></td></tr>";

		txt += "<tr><td align='center' valign='middle'><a id='photoa2' href='photo/photo5/photo006.jpg' rel='lightbox[g1]' target='_blank'><img id='photoi6' src='photo/photot5/photo006.jpg'></a></td></tr></table>";

		$("photo").innerHTML = txt;

		$("lbtn").style.visibility = "hidden";
		$("rbtn").style.visibility = "hidden";
	}
	else {
		cl = 1;
		ct = ct_array[p];
		cd = 5;
		rt = 4;
		pMax = pMax_array[p];

		txt = "<table cellspacing='5'>";

		for (m = 0; m < rt; m++) {
			txt += "<tr>";

			for (n = 0; n < cd; n++) {
				tag = 1 + m + n * rt;
				if (tag < 10) {
					tag = "00" + tag;
				}
				else if (tag < 100) {
					tag = "0" + tag;
				}

				tag2 = 1 + m + n * rt;
				photoj = p + "/photo" + tag + ".jpg";

				if (tag <= pMax) {
					txt += "<td align='center' valign='middle'><a id='photoa";
					txt += tag2;
					txt += "' href='photo/photo";
					txt += photoj;
					txt += "' rel='lightbox[g1]' target='_blank'><img id='photoi";
					txt += tag2;
					txt += "' src='photo/photot";
					txt += photoj;
					txt += "'></a></td>";
				}
				else {
					break;
				}
			}

			txt += "</tr>";
		}

		txt += "</table>";

		$("photo").innerHTML = txt;

		$("lbtn").style.visibility = "hidden";
		$("rbtn").style.visibility = "visible";
	}

	page = p;

/*
	switch (p) {
		case 1:
			$("gallery1").innerHTML = "<p>2008.12.12&nbsp;&nbsp;House of neco&nbsp;&nbsp;Merry merry X'mas SHOW&nbsp;&nbsp;at Mars (part1)</p>";
			break;

		case 2:
			$("gallery1").innerHTML = "<p>2008.12.12&nbsp;&nbsp;House of neco&nbsp;&nbsp;Merry merry X'mas SHOW&nbsp;&nbsp;at Mars (part2)</p>";
			break;

		case 3:
			$("gallery1").innerHTML = "<p>2008.12.20&nbsp;&nbsp;Key's Room&nbsp;&nbsp;at night cafe neco</p>";
			break;

		case 4:
			$("gallery1").innerHTML = "<p>2008.12.31&nbsp;&nbsp;count down party&nbsp;&nbsp;at night cafe neco</p>";
			break;
	}
*/
	$("gallery1").innerHTML = "<p>" + galleryContents[p] + "</p>";
	cursorSet(p);
}

function galleryOver(p) {
	if (page != p) {
		$("gallery2" + p).style.color="#33ccff";
	}

	for (i = 1; i <= galleryMax; i++) {
		if (i != p) {
			$("gallery2" + i).style.color="#FFFFFF";
		}
	}
}

function cursorSet(p) {
	for (i = 1; i <= galleryMax; i++) {
		if (i != p) {
			$("gallery2" + i).style.cursor = "pointer";
		}
		else {
			$("gallery2" + i).style.cursor = "default";
		}
	}
}

var commentNo  = 7;
var commentMin = 0;
var commentMax = 7;

btnOverImg = new Array("", "comment.button.1.2", "comment.button.2.2", "comment.button.3.2");
btnOutImg  = new Array("", "comment.button.1.1", "comment.button.2.1", "comment.button.3.1");
var btnPath = "images/comment/";
var btnExt  = ".gif";
function btnOver(obj) {
	btnId = obj.id;

	if ((btnId =="btn1" && commentNo == commentMin) || (btnId == "btn3" && commentNo == commentMax)) {
		return;
	}

	obj.setAttribute("src", btnPath + btnOverImg[btnId.charAt(3)] + btnExt);
	obj.style.cursor = "pointer";
}
function btnOut(obj) {
	btnId = obj.id;
	obj.setAttribute("src", btnPath + btnOutImg[btnId.charAt(3)] + btnExt);
	obj.style.cursor = "default";
}
function btnGo(obj) {
	btnId = obj.id;
	if (btnId == "btn2") {
			new Effect.ScrollTo("container");
	}
	else if (btnId == "btn1") {
		if (commentNo > commentMin) {
			$(tagGet(commentNo)).style.display = "none";
			commentNo--;
			$(tagGet(commentNo)).style.display = "block";
			new Effect.ScrollTo("container");
		}
	}
	else {
		if (commentNo < commentMax) {
			$(tagGet(commentNo)).style.display = "none";
			commentNo++;
			$(tagGet(commentNo)).style.display = "block";
			new Effect.ScrollTo("container");
		}
	}
}
function tagGet(no) {
	return "comment" + (no < 10 ? "0" : "") + no;
}


