var lastPict=".pict6";
var currPict=".pict6";
var cuPict="pict6";
var zIndex = 100;
var skip = 0;
var DumpMode = 0;

$(function(){
	if(window.location.href.indexOf("dump") >=0)
	{
		DumpMode = 1;
	}

	$('.Btn1').mouseover(function(){
		resetBtn();
		$(this).hide();
		$(this).next().show();
	});
	$('.Btn2').mouseout(function(){
		resetBtn();
	});
	$('.Btn2').mousedown(function(){

		if ($.browser.msie)
		{
			if(window.location.href.search("2010") > 0)
			{
				window.location.href= $(this).attr('alt');
			}
			else
			{
				window.location.href='2010/' + $(this).attr('alt');
			}
		}
		else
		{
			window.location.href=$(this).attr('alt');
		}

	});

	$('.map').click(function(){
		$('#map').attr('src',$(this).attr('href'));
	});


	$('.cpict6').mouseover(function(){
		if(cuPict != $(this).attr('id'))
		{
			cuPict = $(this).attr('id');

			lastPict = currPict;
			currPict = '.' + cuPict;
			zIndex += 100;
			$(currPict).css('z-index',zIndex-10).css('top', "0px");
			$(lastPict).css('z-index',zIndex);
			$(lastPict).css('top', "0px").animate({ top :  "+=203" }, 2000 );
			skip = 2;
		}
	});

	$('.pict6').click(function(){
		window.open("http://banana-room.jp/bosyuu/bosyu2009.html", "_blank");
	});
	$('.pict6').mouseover(function(){
		$(this).css('cursor','pointer');
	});

// pc_page_btn01	新着
// pc_page_btn04	本日の出勤

	var wpath = window.location.href;


	var timekey = (new Date()).getTime();
 	if((wpath.indexOf('index.html') > 0)
 	|| (wpath.indexOf('html') < 0))
 	{
		$('#NewInfo').load("http://blueocean.xaw.jp/cgi-bin/2010/info.cgi", {module : "newInfo" , id : "NewInfo"});
		$('#NewGirlInfo').load("http://blueocean.xaw.jp/cgi-bin/2010/lady_info.cgi", {module : "newInfo" , id : "NewInfo"});

	}

 	if(wpath.indexOf('system.html') > 0)
 	{
		$('#Set').load("http://blueocean.xaw.jp/cgi-bin/2010/db.cgi", {module : "newInfo" , id : "Set"});
		$('#Encho').load("http://blueocean.xaw.jp/cgi-bin/2010/db.cgi", {module : "newInfo" , id : "Encho"});
		$('#Shimei').load("http://blueocean.xaw.jp/cgi-bin/2010/db.cgi", {module : "newInfo" , id : "Shimei"});
		$('#Jyonai').load("http://blueocean.xaw.jp/cgi-bin/2010/db.cgi", {module : "newInfo" , id : "Jyonai"});
		$('#Dohan').load("http://blueocean.xaw.jp/cgi-bin/2010/db.cgi", {module : "newInfo" , id : "Dohan"});
	}

 	if(wpath.indexOf('coupon.html') > 0)
 	{
		$('#limitV').load("http://blueocean.xaw.jp/cgi-bin/2010/dbt.cgi", {module : "newInfo" , id : "Coupon"});
		$('#couponV').load("http://blueocean.xaw.jp/cgi-bin/2010/db.cgi", {module : "newInfo" , id : "Coupon"});
	}

});

$(document).everyTime(5000, function(i)
{
	if(skip > 0)
	{
		skip--;
		return;
	}
	idx = parseInt(lastPict.substring(5)) + 1;
	if(idx == 7)
	{
		idx = 1;
	}
	xcuPict = "pict" + idx;

	while(cuPict == xcuPict)
	{
		idx++;
		if(idx == 7)
		{
			idx = 1;
		}
		xcuPict = "pict" + idx;
	}

	if(cuPict != xcuPict)
	{
		cuPict = xcuPict;

		lastPict = currPict;
		currPict = '.' + cuPict;
		zIndex += 100;
		$(currPict).css('z-index',zIndex-10).css('top', "0px");
		$(lastPict).css('z-index',zIndex);
		$(lastPict).css('top', "0px").animate({ top :  "+=203" }, 2000 );

	}
}, 1000000);

$(document).everyTime(3500, function(i)
{
	topImg = "#infoImg1";
	$('.infoImg').each(function(){
		if(parseInt($(topImg).css('z-index')) > parseInt($(this).css('z-index')))
		{
			topImg = '#' + $(this).attr('id');
		}
	});
	$(topImg).css('z-index',parseInt($(topImg).css('z-index')) + 100).hide().fadeIn(2000);
}, 1000001);


var effectNo = 1;
$(document).everyTime(5000, function(i)
{
	maxZ = 0;
	minZ = 35100;
	maxZID = "";
	$('.info2Img').each(function(){
		if(parseInt($(this).css('z-index')) > maxZ)
		{
			maxZ = parseInt($(this).css('z-index'));
			maxZID = $(this);
		}
		if(parseInt($(this).css('z-index')) < minZ)
		{
			minZ = parseInt($(this).css('z-index'));
		}
	});

	if(maxZID == "")
	{
		return;
	}
	maxZID.css('z-index',minZ-1)
		  .css('left',"0px")
		  .css('top',"0px")
		  .css('width',"100%")
		  .css('height',"100%")
		  .show();


	$('.info2Img').each(function(){
		if(parseInt($(this).css('z-index')) > parseInt(maxZID.css('z-index')))
		{
			maxZID = $(this);
		}
	});

effectNo = Math.floor( Math.random() * 24 )+1;

if(effectNo == 1)
{
	maxZID.fadeOut(2000);
}
else if(effectNo == 2)
{
	maxZID.animate({ top :	"+=316" }, 2000 );
}
else if(effectNo == 3)
{
	maxZID.animate({ left :  "+=614" }, 2000 );
}
else if(effectNo == 4)
{
	maxZID.animate({ top :	"-=316" }, 2000 );
}
else if(effectNo == 5)
{
	maxZID.animate({ left :  "-=614" }, 2000 );
}
else if(effectNo == 6)
{
	maxZID.animate({ left :  "+=614", top :  "+=316"}, 2000 );
}
else if(effectNo == 7)
{
	maxZID.animate({ left :  "+=614", top :  "-=316"}, 2000 );
}
else if(effectNo == 8)
{
	maxZID.animate({ left :  "-=614", top :  "+=316"}, 2000 );
}
else if(effectNo == 9)
{
	maxZID.animate({ left :  "-=614", top :  "-=316"}, 2000 );
}
else if(effectNo == 10)
{
	maxZID.animate({ width : "0%"}, 2000 );
}
else if(effectNo == 11)
{
	maxZID.animate({left : "+307" , width : "0%"}, 2000 );
}
else if(effectNo == 12)
{
	maxZID.animate({left : "+614" , width : "0%"}, 2000 );
}
else if(effectNo == 13)
{
	maxZID.animate({height : "0%"}, 2000 );
}
else if(effectNo == 14)
{
	maxZID.animate({top : "+=158",height : "0%"}, 2000 );
}
else if(effectNo == 15)
{
	maxZID.animate({top : "+=316",height : "0%"}, 2000 );
}
else if(effectNo == 16)
{
	maxZID.animate({width : "0%",height : "0%"}, 2000 );
}
else if(effectNo == 17)
{
	maxZID.animate({left : "+307",width : "0%",height : "0%"}, 2000 );
}
else if(effectNo == 18)
{
	maxZID.animate({left : "+614",width : "0%",height : "0%"}, 2000 );
}
else if(effectNo == 19)
{
	maxZID.animate({top : "+=158",width : "0%",height : "0%"}, 2000 );
}
else if(effectNo == 20)
{
	maxZID.animate({top : "+=158",left : "+307",width : "0%",height : "0%"}, 2000 );
}
else if(effectNo == 21)
{
	maxZID.animate({top : "+=158",left : "+614",width : "0%",height : "0%"}, 2000 );
}
else if(effectNo == 22)
{
	maxZID.animate({top : "+=316",width : "0%",height : "0%"}, 2000 );
}
else if(effectNo == 23)
{
	maxZID.animate({top : "+=316",left : "+307",width : "0%",height : "0%"}, 2000 );
}
else if(effectNo == 24)
{
	maxZID.animate({top : "+=316",left : "+614",width : "0%",height : "0%"}, 2000 );
}

}, 1000005);


function resetBtn()
{
	$('.Btn2').each(function(){
		$(this).hide();
	});
	$('.Btn1').each(function(){
		$(this).show();
	});

}

function fadestart(id)
{
	zidx = 0;
	if(parseInt($('#img1z').css('z-index')) > zidx)
	{
		zidx = parseInt($('#img1z').css('z-index'));
	}
	if(parseInt($('#img2z').css('z-index')) > zidx)
	{
		zidx = parseInt($('#img2z').css('z-index'));
	}
	if(parseInt($('#img3z').css('z-index')) > zidx)
	{
		zidx = parseInt($('#img3z').css('z-index'));
	}
	if(parseInt($('#img4z').css('z-index')) > zidx)
	{
		zidx = parseInt($('#img4z').css('z-index'));
	}
	zidx += 10;

	$(id).css('z-index',zidx).hide().fadeIn(2000);

}


function prevProfile(lady_id)
{
	$('#fullmember').load("./cgi/get_info.cgi", {module : "prevprofile" , ladyid : lady_id});
	var timekey = (new Date()).getTime();
	$("#HiddenZone").load("/cgi-bin/WriteAccessLog.cgi?pm=pc_girl"+ lady_id +"&rf=&" + timekey);
}

function nextProfile(lady_id)
{
	$('#fullmember').load("./cgi/get_info.cgi", {module : "nextprofile" , ladyid : lady_id});
	var timekey = (new Date()).getTime();
	$("#HiddenZone").load("/cgi-bin/WriteAccessLog.cgi?pm=pc_girl"+ lady_id +"&rf=&" + timekey);
}

function profileList()
{
	$('#fullmember').load("./cgi/get_info.cgi", {module : "fullmember"});
	var timekey = (new Date()).getTime();
	$("#HiddenZone").load("/cgi-bin/WriteAccessLog.cgi?pm=pc_page_btn02&rf=&" + timekey);
}


function weekShceduleLink(tm)
{
 	if((window.location.href.indexOf('index.html') > 0)
 	|| (window.location.href.indexOf('html') < 0))
 	{
		$('#weekShcedule').load("./cgi/get_info.cgi", {module : "weekShceduleLink4" , time : tm});
		var timekey = (new Date()).getTime();
		$("#HiddenZone").load("/cgi-bin/WriteAccessLog.cgi?pm=pc_page_btn03&rf=&" + timekey);
	}
	else
	{
		$('#fullShcedule').load("./cgi/get_info.cgi", {module : "weekShceduleLink6" , time : tm});
		var timekey = (new Date()).getTime();
		$("#HiddenZone").load("/cgi-bin/WriteAccessLog.cgi?pm=pc_page_btn02&rf=&" + timekey);
	}
}


var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-4748212-3']);
_gaq.push(['_trackPageview']);

(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();


