function random_color() {
	colorArray = new Array();
	imgUrl = new Array();
	
	colorArray[0] = "#e540dd";
	colorArray[1] = "#4c3fe6";
	colorArray[2] = "#3fe697";
	
	imgUrl[0] = "http://img.sabu.tetuko.com/20110115_1637053.jpg";
	imgUrl[1] = "http://img.sabu.tetuko.com/20110730_1971883.jpg";
	n = Math.floor(Math.random()*colorArray.length);
	n2 = Math.floor(Math.random()*2);
	document.getElementById('oencolor').style.color = colorArray[n];
	
	
	document.getElementById('container').style.backgroundImage = "url(" + imgUrl[n2] + ")";
	
	
}


var pmsc1_cnt = 0;
function show_player(file) {
	var dom = 'http:\/\/naoki.ai7.jp\/';
	if (file == 'night_driving') {
	var music_id = document.getElementById("pmsc1");	//fileの値によって出力先・内容を変える。
	} else if (file == 'cool_illumi') {
	var music_id = document.getElementById("pmsc2");	//fileの値によって出力先・内容を変える。
	} else if (file == 'topaz') {
	var music_id = document.getElementById("pmsc3");	//fileの値によって出力先・内容を変える。
	}

	music_id.style.width  = "400px";
	var dir = 'u';
	dir = 'q' + dir + 'e';
	if (pmsc1_cnt == 0) {
		music_id.innerHTML = "<embed type=audio\/mpeg height=30 width=400 src="+dom+"re"+dir+"st\/tetu_"+file+".mp3 volume='50' autostart='true' repeat='false' loop='false'>";
	}
	pmsc1_cnt = 1;
}

function shpl_ov(file) {
	if (file == 'mu_id1') {
		var music_id = document.getElementById("pmsc1");
	} else if (file == 'mu_id2') {
		var music_id = document.getElementById("pmsc2");
	} else if (file == 'mu_id3') {
		var music_id = document.getElementById("pmsc3");
	}
	music_id.style.background = "#e0c7fb";
	music_id.style.color = "#20166c";
}

function shpl_ou(file) {
	if (file == 'mu_id1') {
		var music_id = document.getElementById("pmsc1");
	} else if (file == 'mu_id2') {
		var music_id = document.getElementById("pmsc2");
	} else if (file == 'mu_id3') {
		var music_id = document.getElementById("pmsc3");
	}
	music_id.style.background = "transparent";
	music_id.style.color = "#333";
}


//---- ↓explain under movie ----//
var show_swt = 0;
function show(obj) {
	if(show_swt == 0) {
		document.getElementById(obj).style.display = "block";
		show_swt = 1;
	} else {
		document.getElementById(obj).style.display = "none";
		show_swt = 0;
	}
}
//---- ↑explain under movie ----//

//---- ↓WmvMovie ----//
function ShowWmvMovie(movieId, fileName, marginBottom) {
	var movieCode;
	movieCode = "<embed src='http://tetu.pya.jp/movie/" + fileName + "' showaudiocontrols='1' showcontrols='1' autostart='1' height='400' width='450'>";
	if (document.getElementById(movieId).innerHTML == "") {
		document.getElementById(movieId).innerHTML = movieCode;
		if(marginBottom == 'true') {
			document.getElementById(movieId).style.marginBottom = "20px";
		}
	} else {
		document.getElementById(movieId).innerHTML = "";
		if(marginBottom == 'true') {
			document.getElementById(movieId).style.marginBottom = "0px";
		}
	
	}
}
//---- ↑WmvMovie ----//

var selectElement;

//---- ↓SidebarMusic ----//
function nkfMusicPlayer(obj, comment, eventElement) {
	if(selectElement == eventElement.id) {
		// 何もしない
	} else {
	
	musicCount = parseInt(document.getElementById('music_count').innerHTML);
	for(i = 1; i < musicCount + 1; i++) {
		document.getElementById('nkf' + i).style.background = "#dbd7ff";
		document.getElementById('nkf' + i).style.color = "#6f6f6f";
		document.getElementById('nkf' + i).style.borderColor = "#88a";
		document.getElementById('nkf' + i).style.borderLeftColor = "#c0b9ff";
		document.getElementById('nkf' + i).style.borderTopColor = "#c0b9ff";
		document.getElementById('nkf' + i).style.paddingTop = "1px";
		document.getElementById('nkf' + i).style.paddingBottom = "1px";
	}
	selectElement = eventElement.id;
	document.getElementById(eventElement.id).style.background = "#bbb7ef";
	document.getElementById(eventElement.id).style.color = "#22f";
	document.getElementById(eventElement.id).style.paddingTop = "2px";
	document.getElementById(eventElement.id).style.paddingBottom = "0px";
	document.getElementById(eventElement.id).style.borderTopColor = "#61779d";
	document.getElementById(eventElement.id).style.borderLeftColor = "#7177ad";
	document.getElementById(eventElement.id).style.borderBottomColor = "#d9dcf6";
	document.getElementById(eventElement.id).style.borderRightColor = "#d9dcf6";

	document.getElementById('nkf_music_player').innerHTML = "<embed type='audio/mpeg' height='30' width='145' src='http://naoki.ai7.jp/" + obj + ".mp3' volume='50' autostart='true' repeat='false' loop='false' bgcolor='#dbd7ff'>";
	if(comment != 'NoComment') {
		document.getElementById('nkf_music_player').innerHTML += "<br>" + comment;
	}
	}
}

function nkfOn(onElement) {
	if(selectElement != onElement.id) {
		onElement.style.color = "#22f";
		onElement.style.background = "#cbc7ef";
	}
}

function nkfOut(onElement) {
	if(selectElement != onElement.id) {
		onElement.style.color = "#6f6f6f";
		onElement.style.background = "#dbd7ff";
	}
}

//---- ↑SidebarMusic ----//

//---- ↓original slide ----//
function elim_start() {
	document.getElementById('swt_sta').style.display = "none";
	document.getElementById('swt_sto').style.display = "inline";
	document.getElementById('on').style.display = "inline";
	document.getElementById('off').style.display = "none";
}

var img_array = new Array(30)
img_array[0] = "1580740" ;
img_array[1] = "1580741" ;
img_array[2] = "1580742" ;
img_array[3] = "1580743" ;
img_array[4] = "1580744" ;
img_array[5] = "1580745" ;
img_array[6] = "1580746" ;
img_array[7] = "1580747" ;
img_array[8] = "1580748" ;
img_array[9] = "1580749" ;
img_array[10] = "1580750" ;
img_array[11] = "1580751" ;
img_array[12] = "1580752" ;
img_array[13] = "1580753" ;
img_array[14] = "1580754" ;
img_array[15] = "1580755" ;
img_array[16] = "1580756" ;
img_array[17] = "1580758" ;
img_array[18] = "1580759" ;
img_array[19] = "1580760" ;
img_array[20] = "1580761" ;
img_array[21] = "1580762" ;
img_array[22] = "1580763" ;
img_array[23] = "1580767" ;
img_array[24] = "1580768" ;
img_array[25] = "1580769" ;
img_array[26] = "1580770" ;
img_array[27] = "1580771" ;
img_array[28] = "1580772" ;
img_array[29] = "1580773" ;





var sld_cnt = 0;
var finish = 0;
var back_ex = 1;
function sld_loop() {
	if(sld_cnt > 29) sld_cnt = 0;
	//if(back_ex == 1) {
	//	document.getElementById('slide_img').style.background = url"";
	//	back_ex = 0;
	//}
	if(finish == 0) {
	document.getElementById('img_num').innerHTML = sld_cnt + 1;
	document.getElementById('slide_img').innerHTML = "<img src='http://img.sabu.tetuko.com/20101216_" +img_array[sld_cnt]+ ".jpg'>";
	document.getElementById('sim_sld_com').innerHTML = com_array[sld_cnt];
	sld_cnt = sld_cnt + 1;
	}
	if (finish == 0) setTimeout("sld_loop()", 3800);
}

function min_sld() {
	if(sld_cnt > 0) {
		sld_cnt = sld_cnt - 1;
	} else {
		sld_cnt = 29;
	}
	document.getElementById('img_num').innerHTML = sld_cnt + 1;
	document.getElementById('slide_img').innerHTML = "<img src='http://img.sabu.tetuko.com/20101216_" +img_array[sld_cnt]+ ".jpg'>";
	document.getElementById('sim_sld_com').innerHTML = com_array[sld_cnt];
}

function plu_sld() {
	if(sld_cnt < 29) {
		sld_cnt = sld_cnt + 1;
	} else {
		sld_cnt = 0;
	}
	document.getElementById('img_num').innerHTML = sld_cnt + 1;
	document.getElementById('slide_img').innerHTML = "<img src='http://img.sabu.tetuko.com/20101216_" +img_array[sld_cnt]+ ".jpg'>";
	document.getElementById('sim_sld_com').innerHTML = com_array[sld_cnt];
}

function sld_ctrl() {
	if (finish == 0) {
		finish = 1;
		document.getElementById('swt_sto').innerHTML = "start";
		document.getElementById('on').style.display = "none";
		document.getElementById('off').style.display = "inline";
	} else {
		finish = 0;
		document.getElementById('swt_sto').innerHTML = "stop";
		document.getElementById('on').style.display = "inline";
		document.getElementById('off').style.display = "none";
		sld_loop();
	}
}

function sim_sld_ov(obj) {
	obj.style.textDecoration = "none";
}

function sim_sld_ou(obj) {
	obj.style.textDecoration = "underline";
}

function sim_sld_ov2(obj) {
	obj.style.textDecoration = "none";
}

function sim_sld_ou2(obj) {
	obj.style.textDecoration = "underline";
}

function sld_min_ov(obj) {
	obj.style.backgroundColor = "#ffc6fc";
	obj.style.cursor = "pointer";
}

function sld_min_ou(obj) {
	obj.style.backgroundColor = "#fff";
}

function sld_plu_ov(obj) {
	obj.style.backgroundColor = "#ffc6fc";
	obj.style.cursor = "pointer";
}

function sld_plu_ou(obj) {
	obj.style.backgroundColor = "#fff";
}



//---- ↑original slide ----//

//---- ↓環境によって動作が異なるため、削除予定 ----//
function ImgInVisible(imgObj) {
	document.getElementById(imgObj).style.display = "none";
}

function ImgVisible(imgObj) {
	document.getElementById(imgObj).style.display = "block";
}
//---- ↑環境によって動作が異なるため、削除予定 ----//

//---- ↓マウスが乗っている間のみ、画像を非表示し、背景を見せる ----//
function ChangeImg(imgObj, fileName) {
	imgObj.src = "http://img.sabu.tetuko.com/" + fileName;
}
//---- ↑マウスが乗っている間のみ、画像を非表示し、背景を見せる ----//


//---- ↓音楽プレーヤー表示 ----//
function show_embed(obj, mp3File, volume) {
	obj.innerHTML = "<embed type='audio/mpeg' height='30' width='400' src='http://naoki.ai7.jp/fmusic/" + mp3File + ".mp3' volume='" + volume + "' autostart='true' repeat='false' loop='false'>";
}

function change_textstyle(obj, textColor, bgColor) {
	obj.style.backgroundColor = bgColor;
	obj.style.color = textColor;
}
//---- ↑音楽プレーヤー表示 ----//


//script type="text/javascript" src="http://naoki.ai7.jp/request/jquery.nivo.slider.js" /script
//script type="text/javascript" src="http://naoki.ai7.jp/request/jquery-1.4.2.min.js" /script


