function setYear(){
	var d_obj = new Date();
	document.write(d_obj.getFullYear());
}

function init() {
	rollover();
	if(document.referrer.indexOf("ugu-violet") == -1){
		if(document.cookie.indexOf("__violet_visited=on") == -1){
			indexLoad();
		}
	}

	tabAction();
	setIframe();
	ladyRollOver();
	photoChange();
	scheduleLadySlide();
	getSchedule();
	rebonEvent();
	linkLeftAction();
	eventMove();
	closeBtnAction();
	newsFlow();
	contactEvent();
	magazineEvent();
	
	try { 
		document.execCommand('BackgroundImageCache', false, true); 
	}catch(e){
		
	}
	
	if(navigator.userAgent.indexOf("Mac") != -1){
		document.body.style.letterSpacing = "-0.1em";
	}
	/*
	if(navigator.userAgent.indexOf("NT 6.0") != -1){
		document.body.style.letterSpacing = "-0.1em";
	}*/
}

window.onload = init;

/*--------------------------基本ロールオーバー---------------------------*/
function rollover() {
	
	if (!document.getElementById){
		return;
	}

	var aPreLoad = new Array();
	var sTempSrc;
	var aImages = document.getElementsByTagName('img');

	for (i=0;i<aImages.length;i++) { 
	
			if (aImages[i].className == 'rollover') {
				var src = aImages[i].getAttribute('src');
				var ftype = src.substring(src.lastIndexOf('.'), src.length);
				var hsrc = src.replace(ftype, '_'+ftype);

				aImages[i].setAttribute('hsrc', hsrc);

				aPreLoad[i] = new Image();
				aPreLoad[i].src = hsrc;

				aImages[i].onmouseover = function() {
				sTempSrc = this.getAttribute('src');
				this.setAttribute('src', this.getAttribute('hsrc'));
			} 

			aImages[i].onmouseout = function() {
			if (!sTempSrc) sTempSrc = this.getAttribute('src').replace('_'+ftype, ftype);
			this.setAttribute('src', sTempSrc);
			}
		}
	}
}
/*---------------------イベントアクション------------------------------*/
function rebonEvent(){
	
	if(document.getElementsByTagName("a")[0]){
		if(navigator.userAgent.indexOf("MSIE 6") != -1){
			var rebon = document.getElementsByTagName("a")[0];

			rebon.parentNode.onclick = function(){
				
				//document.getElementById("lady").width = "700";
				windowHeight = 600;
				windowWidth = 700;
				ladySlide(rebon.href);
			}
			
		}else{
			var rebon = document.getElementsByTagName("a")[0];
			rebon.style.cursor = "pointer";
			var tagetLink = rebon.href;
			rebon.removeAttribute("href");
			rebon.onclick = function(){
				//document.getElementById("lady").style.height = 600+"px";
				windowHeight = 600;
				windowWidth = 700;
				ladySlide(tagetLink);
			}
		}
		//setChristmas();
		//雪setcharacter();
	}
	
	if(document.getElementById("event")){
		var eventTag = document.getElementById("event");
		var aTag = eventTag.getElementsByTagName("a")[0];
		if(aTag.href){
			eventLink = aTag.href;
			aTag.removeAttribute("href");
			eventTag.onmouseover = function(){
				this.style.textDecoration = "underline";
			}
			eventTag.onmouseout = function(){
				this.style.textDecoration = "none";
			}

		}
		
		document.getElementById("event").onclick = function(){
			windowHeight = 600;
			windowWidth = 700;
			ladySlide(eventLink);
		}
	}
}
/*---------------------メールフォームアクション------------------------------*/
function contactEvent(){
	
	if(document.getElementById("contact")){
		
		var mail = document.getElementById("contact");
		var mailTag = mail.getElementsByTagName("a")[0];
		//alert(mailTag.length);
		if(mailTag.href){
			contactLink = mailTag.href;
			mailTag.removeAttribute("href");
			
			mail.onmouseover = function(){
				this.style.textDecoration = "underline";
			}
			mail.onmouseout = function(){
				this.style.textDecoration = "none";
			}
		}
		mail.onclick = function(){
			windowHeight = 600;
			windowWidth = 700;
			ladySlide(contactLink);
		}
	}
}
var contactLink = "";
var eventLink = "";
var magazineLink = "";
/*---------------------メールマガジンアクション------------------------------*/
function magazineEvent(){
	
	if(document.getElementById("magazine")){
		
		var magazine = document.getElementById("magazine");
		var magazineTag = magazine.getElementsByTagName("a")[0];
		//alert(mailTag.length);
		if(magazineTag.href){
			magazineLink = magazineTag.href;
			magazineTag.removeAttribute("href");
			
			magazine.onmouseover = function(){
				this.style.textDecoration = "underline";
			}
			magazine.onmouseout = function(){
				this.style.textDecoration = "none";
			}
		}
		magazineTag.onclick = function(){
			windowHeight = 600;
			windowWidth = 700;
			ladySlide(magazineLink);
		}
	}
}
/*---------------------認証画面表示------------------------------*/
function indexLoad(){
	
	if(document.getElementById("pick_up")){
		var imageDir = "images/";
	}else if(document.getElementById("prof")){
		location.href = "../";
		return;
	}else{
		var imageDir = "../images/";
	}

	if(document.all){
		newHeight = document.body.scrollHeight;
	}else{
		newHeight = document.documentElement.scrollHeight;
	}
	
	//透過背景の生成
	var blackseat = document.createElement("div");
	blackseat.id = "backseat";
	blackseat.style.height = newHeight+"px";
	//認証ボックスの生成
	var wrap = document.createElement("div");
	wrap.id = "index";
	//ロゴ生成
	var logo = document.createElement("img");
	logo.src = imageDir+"index.png";
	var logo_wrap = document.createElement("div");
	logo_wrap.appendChild(logo);
	logo_wrap.id = "index_logo";
	
	//入り口生成
	var dl = document.createElement("dl");
	//18禁マーク	
	var imgObj1 = document.createElement("img");
	imgObj1.src = imageDir+"18mark.png";
	var dt = document.createElement("dt");
	dt.appendChild(imgObj1);
	//enter
	var imgObj2 = document.createElement("img");
	imgObj2.src = imageDir+"enter.png";
	var dd1 = document.createElement("dd");
	dd1.appendChild(imgObj2);
	
	imgObj2.onmouseover = function(){
		this.src =  imageDir+"enter_.png";
	}
	imgObj2.onmouseout = function(){
		this.src = imageDir+"enter.png";
	}
	//leave
	var imgObj3 = document.createElement("img");
	imgObj3.src = imageDir+"leave.png";
	var dd2 = document.createElement("dd");
	
	imgObj3.onmouseover = function(){
		this.src = imageDir+"leave_.png";
	}
	imgObj3.onmouseout = function(){
		this.src =  imageDir+"leave.png";
	}

	dd2.appendChild(imgObj3);
	dd1.id = "enter";
	dd2.id = "leave";
	
	dd1.onclick = function(){
		if(document.getElementById("index")){
			document.body.removeChild(document.getElementById("index"));
			document.body.removeChild(document.getElementById("backseat"));
			
			//Cookie設定
			var names = "__violet_visited";
			//var expires = "Tue, 31-Dec-2030 23:59:59";
			var cookieData = "";
			var cookieValue = "";
			
			document.cookie = names+"=on";

		}
	}
	dd2.onclick = function(){
		location.href = "http://www.google.co.jp";
	}
	
	if(navigator.userAgent.indexOf("MSIE 6") != -1){
		
		logo_wrap.style.filter =  "progid:DXImageTransform.Microsoft.AlphaImageLoader(sizingMethod=scale,src='"+imageDir+"index.png');";
		dt.style.filter =  "progid:DXImageTransform.Microsoft.AlphaImageLoader(sizingMethod=scale,src='"+imageDir+"18mark.png');";
		dd1.style.filter =  "progid:DXImageTransform.Microsoft.AlphaImageLoader(sizingMethod=scale,src='"+imageDir+"enter.png');";
		dd2.style.filter =  "progid:DXImageTransform.Microsoft.AlphaImageLoader(sizingMethod=scale,src='"+imageDir+"leave.png');";

		dd1.onmouseover = function(){
			this.style.filter =  "progid:DXImageTransform.Microsoft.AlphaImageLoader(sizingMethod=scale,src='"+imageDir+"enter_.png');";
		}
		dd1.onmouseout = function(){
			this.style.filter =  "progid:DXImageTransform.Microsoft.AlphaImageLoader(sizingMethod=scale,src='"+imageDir+"enter.png');";
		}
		dd2.onmouseover = function(){
			this.style.filter =  "progid:DXImageTransform.Microsoft.AlphaImageLoader(sizingMethod=scale,src='"+imageDir+"leave_.png');";
		}
		dd2.onmouseout = function(){
			this.style.filter =  "progid:DXImageTransform.Microsoft.AlphaImageLoader(sizingMethod=scale,src='"+imageDir+"leave.png');";
		}
	}
	
	
	dl.appendChild(dt);
	dl.appendChild(dd1);
	dl.appendChild(dd2);
	var param = decodeURI("%E2%80%BB%E5%BD%93%E3%82%B5%E3%82%A4%E3%83%88%E3%81%AF%E3%82%A2%E3%83%80%E3%83%AB%E3%83%88%E3%82%B3%E3%83%B3%E3%83%86%E3%83%B3%E3%83%84%E3%82%92%E5%90%AB%E3%81%BF%E3%81%BE%E3%81%99%E3%80%8218%E6%AD%B3%E6%9C%AA%E6%BA%80%E3%81%AE%E6%96%B9%E3%81%AE%E5%85%A5%E5%A0%B4%E3%82%92%E3%81%8A%E6%96%AD%E3%82%8A%E3%81%97%E3%81%A6%E3%81%84%E3%81%BE%E3%81%99%E3%80%82%3Cbr%20/%3E%E6%96%B0%E9%A2%A8%E5%96%B6%E6%B3%95%E5%B1%8A%E5%87%BA%E6%B8%88%E5%84%AA%E8%89%AF%E5%BA%97%20%E5%8F%97%E7%90%86%E7%95%AA%E5%8F%B710317%E5%8F%B7");
	var desc = document.createElement("p");
	desc.innerHTML = param;
	wrap.appendChild(logo_wrap);
	wrap.appendChild(dl);
	wrap.appendChild(desc);
	var d_obj = new Date();
	var copyright = decodeURI("copyright%20(c)%20"+d_obj.getFullYear()+"%20VIOLET%20all%20right%20reserved.");
	var foot = document.createElement("p");
	foot.id = "footer";
	foot.innerHTML = copyright;
	wrap.appendChild(foot);
	
	document.body.insertBefore(wrap,document.body.firstChild);
	document.body.insertBefore(blackseat,document.body.firstChild);
}

function tabAction(){

	if(!document.getElementById("flash")){
		return;
	}
	
	var mode = "";
	var prof = document.getElementById("pick_up_movie").getElementsByTagName("p")[0];
	
	
	document.getElementById("photo").onclick = function(){
		this.style.cursor = "auto";
		document.getElementById("movie").style.cursor = "pointer";

		this.src = "images/tab_photo_.gif";
		document.getElementById("movie").src = "images/tab_movie.gif";

		if(mode != "photo"){
			
			var puSrc = document.getElementById("flash").className;
			var pickPhoto = document.createElement("img");
			pickPhoto.id = "puimage";
			pickPhoto.src = "ladies/"+puSrc+"/pickup.jpg";

			var flashPlayer = document.getElementById("pickupswf");
			document.getElementById("flash").replaceChild(pickPhoto,flashPlayer);
			
			prof.style.height = "50px";

		}
	
		mode = "photo";
	}
	
	if(document.getElementById("movie")){
	
		var tmpJpg = new Image();
		tmpJpg.src = "ladies/"+document.getElementById("flash").className+"/pickup.jpg";
	
		document.getElementById("photo").style.cursor = "pointer";
	//	document.getElementById("movie").style.cursor = "pointer";
	
		document.getElementById("movie").onclick = function(){
			this.style.cursor = "auto";
			document.getElementById("photo").style.cursor = "pointer";

			this.src = "images/tab_movie_.gif";
			document.getElementById("photo").src = "images/tab_photo.gif";

			if(mode != "movie" && mode != ""){
			
				var puSrc = document.getElementById("flash").className;
				swf = createMoviePlayer(movie_path);
				var puphoto = document.getElementById("puimage");
				document.getElementById("flash").replaceChild(swf,puphoto);
			
				prof.style.height = "84px";
			}
			mode = "movie";
		}
		
	}else{
		prof.style.height = "50px";
	}
	
}

function createMoviePlayer(ladyName){

	var swf = document.createElement("div");

	swf.id = "ladyRoll";
	swf.innerHTML = "<embed />";
	swf.firstChild.src = "swf/movie.swf";
	swf.firstChild.quality 	= "high";
	swf.id = "pickupswf";
	swf.firstChild.height = "285";
	swf.firstChild.width = "240";
	swf.firstChild.setAttribute("wmode","opaque");
	//swf.firstChild.setAttribute("FlashVars","path=../ladies/"+ladyName+"/movie.flv");
	swf.firstChild.setAttribute("FlashVars","path="+ladyName);
	swf.firstChild.setAttribute("type","application/x-shockwave-flash");
	swf.firstChild.setAttribute("pluginspage","http://www.macromedia.com/go/getflashplayer");

	return swf;
}
/*--------------------------インラインフレーム生成------------------------------*/
function setIframe(){
/*
	if(!document.getElementById("ladies_list") && !document.getElementById("today")){
		return;
	}*/
	var ladyBlock = document.createElement("div");
	ladyBlock.id = "lady_block";
	ladyBlock.style.display = "none";
	
	var iframe = document.createElement("iframe");
	iframe.id = "lady";
	iframe.name = "lady";
	iframe.width = "882";
	iframe.height = "558";
	iframe.setAttribute("frameBorder","0");
	iframe.setAttribute("allowTransparency","true");
	iframe.setAttribute("scrolling","no")
	//iframe.innerHTML = "%E3%82%A4%E3%83%B3%E3%83%A9%E3%82%A4%E3%83%B3%E3%83%95%E3%83%AC%E3%83%BC%E3%83%A0%E3%82%92%E4%BD%BF%E7%94%A8%E3%81%97%E3%81%A6%E3%81%8A%E3%82%8A%E3%81%BE%E3%81%99%E3%80%82%E5%AF%BE%E5%BF%9C%E3%81%AE%E3%83%96%E3%83%A9%E3%82%A6%E3%82%B6%E3%81%A7%E3%81%8A%E6%A5%BD%E3%81%97%E3%81%BF%E3%81%8F%E3%81%A0%E3%81%95%E3%81%84%E3%80%82";

	ladyBlock.appendChild(iframe);
	
	var blackSeat = document.createElement("div");
	blackSeat.id = "blackseat";
	blackSeat.style.display = "none";
	
	document.body.appendChild(ladyBlock);
	document.body.appendChild(blackSeat);

	ladyBlock.onclick = function(){
		iframe.src = "";
		blackSeat.style.display = "none";
		this.style.display = "none";
	}
}

/*--------------------------変数定義------------------------------*/
	var linkArray = new Array();
	var baseImage = "";
	var nowFade = 0;
	var fadeTime = "";
	var ladyFade = "";
	var nowHeight = 0;
	var nowWidth = 0;
	var widthTime = "";
	var firstTime = true;
	var Movescroll = 338;
	var target = 338;
	var linkArrayWeek = new Array();
	if(navigator.userAgent.indexOf("Firefox") != -1 || navigator.userAgent.indexOf("Chrome") != -1){
		interval = 70;
	}else{
		interval = 1;
	}
	var windowHeight = 0;
	var windowWidth = 0;
	var movie_path = "";
	
/*--------------------------女性一覧ロールオーバー------------------------------*/
function ladyRollOver(){

	if(!document.getElementById("ladies_list")){
		return;
	}
	var allLady = document.getElementById("ladies_list").getElementsByTagName("dl");
	
	for(i=0;i<allLady.length;i++){

		linkTag = allLady[i].getElementsByTagName("a")[0];
		linkArray.push(linkTag.href);
		linkTag.removeAttribute("href");
		allLady[i].place = i;

		allLady[i].onclick = function(){
			
			windowHeight = 558;
			windowWidth = 882;
			
			ladySlide(linkArray[this.place]);

		}

		allLady[i].onmouseover = function(){
			baseImage = this.style.backgroundImage;
			this.style.backgroundImage = "url(images/lady_back_.jpg)";
		}
		allLady[i].onmouseout = function(){
			this.style.backgroundImage = baseImage;
		}
	}
}
/*--------------------------スケジュール一覧ロールオーバー------------------------------*/
function scheduleLadySlide(){
	
	if(!document.getElementById("today")){
		return;
	}

	var smallWindow = document.createElement("div");
	smallWindow.style.width = "70px";
	smallWindow.style.height = "20px";
	smallWindow.style.textAlign = "center";
	smallWindow.style.padding = "2px";
	smallWindow.style.color = "#FFFFFF";
	smallWindow.style.backgroundColor = "#004d05";
	smallWindow.style.border = "solid 1px #00ff12";
	smallWindow.style.position = "absolute";
	
	
	var allLady = document.getElementById("today").getElementsByTagName("dl");
	var allLadyWeek = document.getElementById("week").getElementsByTagName("div");

	for(i=0;i<allLady.length;i++){

		linkTag = allLady[i].getElementsByTagName("a")[0];
		linkArray.push(linkTag.href);
		
		if(linkArray[i].indexOf("javascript") == -1){
			
			linkTag.removeAttribute("href");
			allLady[i].place = i;
	
			allLady[i].onclick = function(){
		
				windowHeight = 558;
				windowWidth = 882;
			
				ladySlide(linkArray[this.place]);
				//alert();
			}
		}else{
			linkTag.removeAttribute("href");
			allLady[i].onclick = function(){
				noLady();
			}
		}

		allLady[i].onmouseover = function(){
			if(navigator.userAgent.indexOf("MSIE 6") != -1){
				this.style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(sizingMethod=scale,src='images/lady_back_.png');";
			}else{
				baseImage = this.style.backgroundImage;
				this.style.backgroundImage = "url(images/lady_back_.png)";
			}
		}
		allLady[i].onmouseout = function(){
			if(navigator.userAgent.indexOf("MSIE 6") != -1){
				this.style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(sizingMethod=scale,src='images/lady_back.png');";
			}else{
				this.style.backgroundImage = baseImage;
			}
		}

	}
	for(i=0;i<allLadyWeek.length;i++){

		linkTagWeek = allLadyWeek[i].getElementsByTagName("a")[0];
		linkArrayWeek.push(linkTagWeek.href);
	
		if(linkArrayWeek[i].indexOf("javascript") == -1){
			linkTagWeek.removeAttribute("href");
			allLadyWeek[i].place = i;

			allLadyWeek[i].onclick = function(){
				windowHeight = 558;
				windowWidth = 882;
				ladySlide(linkArrayWeek[this.place]);
				//alert();
			}
		}else{
			linkTagWeek.removeAttribute("href");
			allLadyWeek[i].onclick = function(){
				noLady();
			}
		}
		allLadyWeek[i].onmouseover = function(){
			//baseImage = this.style.backgroundColor;
			this.style.backgroundColor = "#00ff12";
			//this.className = "lady_week_over";
			var alt = this.getElementsByTagName("img")[0].alt;
			smallWindow.innerHTML = alt;
			this.appendChild(smallWindow);
		}
		allLadyWeek[i].onmouseout = function(){
			this.style.backgroundColor = "#004d05";
			//this.className = "lady_week";
			smallWindow.parentNode.removeChild(smallWindow);
		}
	}

}
/*--------------------------女性詳細アクションー------------------------------*/
function ladySlide(src){

	document.getElementById("lady").src = src;
	//document.getElementById("lady_block").style.display = "block";
	document.getElementById("blackseat").style.display = "block";
	//document.getElementById("blackseat").setAttribute("-moz-opacity","0");
	document.getElementById("blackseat").style.filter = "alpha(opacity=0)";
	document.getElementById("blackseat").style.opacity = "0";
	nowFade = 0;
	firstTime = true;
	
	if(document.all){
		newHeight = document.body.scrollHeight;
		browserHeight = document.documentElement.clientHeight;
	}else{
		newHeight = document.documentElement.scrollHeight;
		browserHeight = window.innerHeight;
	}
	
	if(document.documentElement.scrollTop){
		newTop = document.documentElement.scrollTop;
	}else{
		newTop = document.body.scrollTop;
	}
	
	if(browserHeight < 558){
		document.getElementById("lady").height = browserHeight-160;
	}else{
		document.getElementById("lady").height ="558";
	}
	
	document.getElementById("lady").style.top = newTop+80+"px";
	document.getElementById("lady_block").style.height = newHeight+"px";
	document.getElementById("blackseat").style.height = newHeight+"px";
	fadeTime = setInterval(fadeLady,interval);
}
/*--------------------------フェードイン------------------------------*/
function fadeLady(){
	
	//nowFade += Math.ceil((80-nowFade)/2);
	nowFade += 15;
	
	document.getElementById("blackseat").style.filter = "alpha(opacity="+nowFade+")";
	//document.getElementById("blackseat").setAttribute("-moz-opacity",nowFade/100);
	document.getElementById("blackseat").style.opacity = nowFade/100;
	
	
	if(nowFade >= 80){
		clearInterval(fadeTime);
		document.getElementById("lady_block").style.display = "block";
		document.getElementById("lady").height = "5";
		document.getElementById("lady").width = "5";
		//document.getElementById("lady").setAttribute("scrolling","no");
		//document.getElementById("lady").style.overflow = "hidden";
		document.getElementById("blackseat").style.filter = "alpha(opacity=80)";
		document.getElementById("blackseat").style.opacity = "0.8";
		
		nowHeight = 0;
		nowWidth = 0;
		ladyFade = setInterval(blockFade,interval);
	}
}
/*--------------------------オーバーレイ------------------------*/
function blockFade(){

	nowHeight += (windowHeight-nowHeight)/3;
	//nowWidth += (888-nowWidth)/2;

	document.getElementById("lady").height = nowHeight;
	//document.getElementById("lady").width = nowWidth;

	if(nowHeight > 400){
		if(firstTime){
			widthTime = setInterval(widthFade,interval);
			nowWidth = 0;
			firstTime = false;
		}
	}

	if(nowHeight > windowHeight){
		document.getElementById("lady").height = windowHeight;
		clearInterval(ladyFade);
	}

}
/*-------------------------横アクション------------------------*/
function widthFade(){
	//nowWidth += (900-nowWidth)/2;
	nowWidth = (nowWidth+1)*1.8;
	document.getElementById("lady").width = nowWidth;
	if(nowWidth > windowWidth){
		document.getElementById("lady").width = windowWidth;
		clearInterval(widthTime);
	}
}
/*-------------------------閉じるボタン------------------------*/
function closeBtnAction(){

	if(!document.getElementById("close")){
		return;
	}

	document.getElementById("close").onclick = function(){
		if(window.parent.document.getElementById("blackseat")){
			window.parent.document.getElementById("lady").src = "";
			window.parent.document.getElementById("blackseat").style.display = "none";
			window.parent.document.getElementById("lady_block").style.display = "none";
		}else{
			window.close();
		}
	}

}

/*------------------------女性詳細写真切替------------------------*/
function photoChange(){

	if(!document.getElementById("image")){
		return;
	}
	
	closeBtnAction();
	
	var base = document.getElementById("image").getElementsByTagName("img")[0];
	base.style.display = "none";

	var imageList = new Array();
	for(i=1;i<=4;i++){
//		//imageList[i] = document.createElement("img");
		tmpImage = new Image();
		tmpImage.src = "pic0"+i+".jpg";
		imageList.push(tmpImage);
	}

	if(imageList[0].width > 300){
		base.style.marginTop = "50px";
	}
	base.style.display = "";

	var sumArray = document.getElementsByTagName("img");
	for(i=0;i<sumArray.length;i++){

		if(sumArray[i].className == "thumb"){

			sumArray[i].onmouseover = function(){

				var targetImg = document.getElementById("image").getElementsByTagName("img")[0];

				var tmpSrc = this.src.split("thumb0");
				var tmpNumber = tmpSrc[1].split(".");
				var srcNumber = tmpNumber[0]-1;
				//var targetSrc = "pic"+tmpSrc[1];

				targetImg.src = imageList[srcNumber].src;
				
				if(imageList[srcNumber].height == 300){
					targetImg.style.marginTop = "50px";
				}else{
					targetImg.style.marginTop = "0";
				}
			
			}
		
		}
	
	}
}
function noLady(){
	alert("詳細はTELにてご確認ください。");
}

function showMovie(ladyPath){
	
	//var moviePath = "../ladies/"+ladyPath+"/movie.flv";
	var moviePath = "../ladies/"+ladyPath;
	
	document.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0" width="240" height="285" id="movie" align="middle">');
	document.write('<param name="allowScriptAccess" value="sameDomain" />');
	document.write('<param name="allowFullScreen" value="false" />');
	document.write('<param name="movie" value="../../swf/movie.swf" />');
	document.write('<param name="FlashVars" value="path='+moviePath+'" />');
	document.write('<param name="quality" value="high" />');
	document.write('<param name="bgcolor" value="#000000" />');
	document.write('<embed src="../../swf/movie.swf" FlashVars="path='+moviePath+'" quality="high" bgcolor="#000000" width="240" height="285" name="movie" align="middle" allowScriptAccess="sameDomain" allowFullScreen="false" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />');
	document.write('</object>');
}

function pickupMovie(ladyPath){

	//var moviePath = "../ladies/"+ladyPath+"/movie.flv";
	var moviePath = "../ladies/"+ladyPath;
	movie_path = moviePath;

	document.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0" width="240" height="285" id="pickupswf" align="middle">');
	document.write('<param name="allowScriptAccess" value="sameDomain" />');
	document.write('<param name="allowFullScreen" value="false" />');
	document.write('<param name="movie" value="swf/movie.swf" />');
	document.write('<param name="quality" value="high" />');
	document.write('<param name="wmode" value="opaque" />');
	document.write('<param name="FlashVars" value="path='+moviePath+'" />');
	document.write('<param name="bgcolor" value="#000000" />');
	document.write('<embed src="swf/movie.swf" FlashVars="path='+moviePath+'" wmode="opaque" quality="high" bgcolor="#000000" width="240" height="285" name="movie" align="middle" allowScriptAccess="sameDomain" allowFullScreen="false" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />');
	document.write('</object>');
}



function getSchedule(){

	if(!document.getElementById("image")){
		return;
	}
	var tmpUrl = location.href;
	var tmpLadyName = tmpUrl.split("ladies/");
	var LadyName = tmpLadyName[1].split("/");
	var param="ladyName="+LadyName[0];

	Ajax = create_Ajax();
	//送信
	Ajax.open("POST","../../schedule/index.php");
	Ajax.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8');
	Ajax.send(param);

	//受信
	Ajax.onreadystatechange = function(){

		if(Ajax.readyState == 4 && Ajax.status == 200){
			var scheduleList = Ajax.responseText;
			if(scheduleList != ""){
				var schedule = document.createElement("div");
				schedule.innerHTML = scheduleList;
				document.getElementById("footer").insertBefore(schedule,document.getElementById("footer").firstChild);
			}
		}
	}
}


function create_Ajax(){

	if(window.XMLHttpRequest){
		Ajax = new XMLHttpRequest();
	}else if(window.ActiveXObject){
		try {
			Ajax = new ActiveXObject("Msxm21.XMLHTTP");
		} catch(e) {
			Ajax = new ActiveXObject("Microsoft.XMLHTTP");
		}
	}
	return Ajax;
}

function eventWindow(){
	window.open("","event","width=500,height=500, menubar=no, toolbar=no, scrollbars=no");
}

function contactWindow(){
	window.open("","contact","width=500,height=500, menubar=no, toolbar=no, scrollbars=no");
}

function linkLeftAction(){
	if(!document.getElementById("link")){
		return;
	}

	document.getElementById("link").style.position = "absolute";
	document.getElementById("link").style.top = "338px";
	
	if(navigator.userAgent.indexOf("Firefox") != -1 || navigator.userAgent.indexOf("Chrome") != -1){
		slideInterval = 30;
	}else{
		slideInterval = 1;
	}
	moveInterval();
	
}

function moveInterval(){
	setInterval(linkset,slideInterval);
}

function linkset(){

	if(navigator.appName == "Opera" || navigator.userAgent.indexOf("Firefox") != -1){
		Movescroll = document.documentElement.scrollTop;
		browHeight = window.innerHeight;
	}else if(document.all){
		Movescroll = document.documentElement.scrollTop;
		browHeight = document.documentElement.clientHeight;
	}else{
		Movescroll = document.body.scrollTop;
		browHeight = window.innerHeight;
	}
	
	if(document.all){
		maxscroll = document.body.scrollHeight;
	}else{
		maxscroll = document.documentElement.scrollHeight;
	}
	if(Movescroll < 338){
		Movescroll = 338;
	}

	target += (Movescroll-target)/5;
	if(target > (maxscroll-338-480)){
		target = maxscroll-338-480;
	}
	document.getElementById("link").style.top = target+"px";

}


function eventMove(){
	if(!document.getElementById("event_area")){
		return;
	}

	var eventList = document.getElementById("event_list").getElementsByTagName("div");
	
	for(i=0;i<eventList.length;i++){
		
		//tmp_back = eventList[i].style.background;
		eventList[i].position = i;

		eventList[i].onmouseover = function(){
			this.style.background = "url(images/block_.gif) no-repeat left top";
		}
		eventList[i].onmouseout = function(){
			//this.style.background = tmp_back;
			this.style.background = "none";
		}
		eventList[i].onclick = function(){

			clearInterval(eventInterval);

			if(navigator.userAgent.indexOf("Firefox") != -1 || navigator.userAgent.indexOf("Chrome") != -1){
				eventSlideInterval = 30;
			}else{
				eventSlideInterval = 1;
			}
			eventInterval = setInterval("eventSlide("+this.position+")",eventSlideInterval);
		}

	}
}

var nowPosition = 0;
var eventInterval = "";

function eventSlide(targetPosition){

	if(navigator.userAgent.indexOf("MSIE 6") != -1){
		nowPosition += Math.floor(((targetPosition*345)-nowPosition)/4);
	}else{
		nowPosition += ((targetPosition*334)-nowPosition)/4;
	}

	var moveTarget = document.getElementById("move_area");

	moveTarget.style.top = -nowPosition+"px";
	
	if(navigator.userAgent.indexOf("MSIE 6") != -1){
		if(nowPosition <= (targetPosition*344)+2 && nowPosition >= (targetPosition*344)-2){
			moveTarget.style.top = -(targetPosition*344)+"px";
			clearInterval(eventInterval);
		}
	}else{
		if(nowPosition <= (targetPosition*334)+2 && nowPosition >= (targetPosition*334)-2){
			moveTarget.style.top = -(targetPosition*334)+"px";
			clearInterval(eventInterval);
		}
	}

}
/*---------------------新着------------------------*/
function newsFlow(){

	if(!document.getElementsByTagName("dl")[0]){
		return;
	}

	if(document.getElementById("image")){
		return;
	}

	var dlList = document.getElementsByTagName("dl");
	for(i=0;i<dlList.length;i++){
		if(dlList[i].className == "wn"){
			whatNewDL = dlList[i];
			break;
		}
	}
	if(whatNewDL == ""){
		return;
	}
	
	if(document.getElementById("topics")){
		var php = "news/index.php";
	}else{
		var php = "../news/index.php";
	}
	
	Ajax = create_Ajax();
	//送信
	Ajax.open("POST",php);
	Ajax.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8');
	Ajax.send(null);

	Ajax.onreadystatechange = function(){

	if(Ajax.readyState == 4 && Ajax.status == 200){
		
		whatNewDD = whatNewDL.getElementsByTagName("dd")[0];
		whatNewDD.innerHTML = Ajax.responseText;
		whatNewDD.style.letterSpacing = "90px";
		spanInteval = setInterval("spacingSlide()",1);}
	}
}
var nowSpan = 90;
var whatNewDL = "";
var whatNewDD = "";
var spanInteval = "";

function spacingSlide(){

	if(navigator.userAgent.indexOf("Mac") != -1){
		nowSpan += (-0.1-nowSpan)/20;
		whatNewDD.style.letterSpacing = nowSpan+"em";
	}else{
		nowSpan += Math.floor((1-nowSpan)/60);
		whatNewDD.style.letterSpacing = nowSpan+"px";
	}
	
	
	if(nowSpan == 1){
		clearInterval(spanInteval);
	}

}


function setChristmas(){

	var img = document.createElement("img");
	img.src = "http://www.ugu-violet.com/images/christmas.jpg";

	var header = document.getElementsByTagName("h2")[0];
	header.appendChild(img);

	var snow = document.createElement("div");
	snow.id = "snow";
	
	snow.innerHTML = "<embed />";
	snow.firstChild.src = "http://www.ugu-violet.com/swf/snow.swf";

	snow.firstChild.quality = "high";
	snow.firstChild.height = "190";
	snow.firstChild.width = "900";
	snow.firstChild.setAttribute("wmode","transparent");
	snow.firstChild.setAttribute("type","application/x-shockwave-flash");
	snow.firstChild.setAttribute("pluginspage","http://www.macromedia.com/go/getflashplayer");
	
	//header.parentNode.style.position = "relative";
	
	/*header.parentNode.zIndex = "100";*/
	//snow.style.zIndex = "100";
	//snow.style.marginTop = "-190px";
	//header.parentNode.insertBefore(snow,header.parentNode.firstChild);
	
	//document.body.appendChild(snow);
	//
	
	if(document.all){
		snow.style.position = "absolute";
		snow.firstChild.style.position = "absolute";
		snow.firstChild.style.left = "-450px";
		document.body.insertBefore(snow,document.body.firstChild);
	}else{
		snow.style.position = "absolute";
		snow.style.top = "0";
		header.parentNode.appendChild(snow);
	}
}
function setcharacter(){
	/*
	var img = document.createElement("img");
	img.src = "http://www.ugu-violet.com/images/character.jpg";
	img.height = "167";
	img.width = "246";
	var header = document.getElementsByTagName("h2")[0];
	header.appendChild(img);
	img.style.paddingLeft = 126+"px";
	img.style.paddingTop = 0+"px";
	*/
	var snow = document.createElement("div");
	snow.id = "snow";
	
	snow.innerHTML = "<embed />";
	snow.firstChild.src = "http://www.ugu-violet.com/swf/snow.swf";

	snow.firstChild.quality = "high";
	snow.firstChild.height = "190";
	snow.firstChild.width = "900";
	snow.firstChild.setAttribute("wmode","transparent");
	snow.firstChild.setAttribute("type","application/x-shockwave-flash");
	snow.firstChild.setAttribute("pluginspage","http://www.macromedia.com/go/getflashplayer");
	
	//header.parentNode.style.position = "relative";
	
	/*header.parentNode.zIndex = "100";*/
	//snow.style.zIndex = "100";
	//snow.style.marginTop = "-190px";
	//header.parentNode.insertBefore(snow,header.parentNode.firstChild);
	
	//document.body.appendChild(snow);
	//
	
	if(document.all){
		snow.style.position = "absolute";
		snow.firstChild.style.position = "absolute";
		snow.firstChild.style.left = "-450px";
		document.body.insertBefore(snow,document.body.firstChild);
	}else{
		snow.style.position = "absolute";
		snow.style.top = "0";
		header.parentNode.appendChild(snow);
	}
}

function magazineWin(){
	window.open("","magazine","width=500,height=400,scrollbars=no");
	
	return true;
}