/* var rdir = "/20100906work"; */
/* var rdir = "/test"; */
var rdir = "";

var yajir_ac = 'url("' + rdir + '/common/images/lmenu/yajir_ac.gif") no-repeat scroll left top transparent';
var yajid_ac = 'url("' + rdir + '/common/images/lmenu/yajid_ac.gif") no-repeat scroll left top transparent';
var yajir_of = 'url("' + rdir + '/common/images/lmenu/yajir_of.gif") no-repeat scroll left top transparent';
var yajid_of = 'url("' + rdir + '/common/images/lmenu/yajid_of.gif") no-repeat scroll left top transparent';

var minus1_ac = 'url("' + rdir + '/common/images/lmenu/icon_minus1_ac.gif") no-repeat scroll left top transparent';
var plus1_ac  = 'url("' + rdir + '/common/images/lmenu/icon_plus1_ac.gif") no-repeat scroll left top transparent';
var minus1_of = 'url("' + rdir + '/common/images/lmenu/icon_minus1_of.gif") no-repeat scroll left top transparent';
var plus1_of  = 'url("' + rdir + '/common/images/lmenu/icon_plus1_of.gif") no-repeat scroll left top transparent';

var minus_ac = 'url("' + rdir + '/common/images/lmenu/icon_minus_ac.gif") no-repeat scroll left top transparent';
var plus_ac  = 'url("' + rdir + '/common/images/lmenu/icon_plus_ac.gif") no-repeat scroll left top transparent';
var minus_of = 'url("' + rdir + '/common/images/lmenu/icon_minus_of.gif") no-repeat scroll left top transparent';
var plus_of  = 'url("' + rdir + '/common/images/lmenu/icon_plus_of.gif") no-repeat scroll left top transparent';


var ic_yjr_ac = 'yajir_ac';
var ic_yjd_ac = 'yajid_ac';
var ic_yjr_of = 'yajir_of';
var ic_yjd_of = 'yajid_of';

var ic_mi1_ac = 'icon_minus1_ac';
var ic_pl1_ac = 'icon_plus1_ac';
var ic_mi1_of = 'icon_minus1_of';
var ic_pl1_of = 'icon_plus1_of';

var ic_mi_ac = 'icon_minus_ac';
var ic_pl_ac = 'icon_plus_ac';
var ic_mi_of = 'icon_minus_of';
var ic_pl_of = 'icon_plus_of';

/*--------------------
 yaji๓ิoึ1
--------------------*/
function ic_yaji(id0, aoflg){
	var ret;
	var st = document.getElementById(id0).style.background.indexOf("yaji");
	var ed = document.getElementById(id0).style.background.indexOf(".gif");
	var bglen = document.getElementById(id0).style.background.length;
	// alert(st);
	// alert(ed);
	// alert(bglen);
	
	var bg_st = document.getElementById(id0).style.background.slice(0, st);
	var bg_ico = document.getElementById(id0).style.background.slice(st, ed);
	var bg_ed = document.getElementById(id0).style.background.slice(ed, bglen);
	// alert(bg_st);
	// alert(bg_ico);
	// alert(bg_ed);
	
	if (aoflg == 'of') {
		if ((bg_ico == ic_yjr_of) || (bg_ico == '')) {
			ret = bg_st + ic_yjd_of + bg_ed;
		} else {
			ret = bg_st + ic_yjr_of + bg_ed;
		}
	}
	if (aoflg == 'ac') {
		if ((bg_ico == ic_yjr_ac) || (bg_ico == '')) {
			ret = bg_st + ic_yjd_ac + bg_ed;
		} else {
			ret = bg_st + ic_yjr_ac + bg_ed;
		}
	}
	return ret;
}


/*--------------------
 icon๓ิoึ1
--------------------*/
function ic_slice1(id0, aoflg){
	var ret;
	var st = document.getElementById(id0).style.background.indexOf("icon");
	var ed = document.getElementById(id0).style.background.indexOf(".gif");
	var bglen = document.getElementById(id0).style.background.length;
	// alert(st);
	// alert(ed);
	// alert(bglen);
	
	var bg_st = document.getElementById(id0).style.background.slice(0, st);
	var bg_ico = document.getElementById(id0).style.background.slice(st, ed);
	var bg_ed = document.getElementById(id0).style.background.slice(ed, bglen);
	// alert(bg_st);
	// alert(bg_ico);
	// alert(bg_ed);
	
	if (aoflg == 'of') {
		if ((bg_ico == ic_pl1_of) || (bg_ico == '')) {
			ret = bg_st + ic_mi1_of + bg_ed;
		} else {
			ret = bg_st + ic_pl1_of + bg_ed;
		}
	}
	if (aoflg == 'ac') {
		if ((bg_ico == ic_pl1_ac) || (bg_ico == '')) {
			ret = bg_st + ic_mi1_ac + bg_ed;
		} else {
			ret = bg_st + ic_pl1_ac + bg_ed;
		}
	}
	return ret;
}


/*--------------------
 icon๓ิoึ2
--------------------*/
function ic_slice2(id0, aoflg){
	var ret;
	var st = document.getElementById(id0).style.background.indexOf("icon");
	var ed = document.getElementById(id0).style.background.indexOf(".gif");
	var bglen = document.getElementById(id0).style.background.length;
	// alert(st);
	// alert(ed);
	// alert(bglen);
	
	var bg_st = document.getElementById(id0).style.background.slice(0, st);
	var bg_ico = document.getElementById(id0).style.background.slice(st, ed);
	var bg_ed = document.getElementById(id0).style.background.slice(ed, bglen);
	// alert(bg_st);
	// alert(bg_ico);
	// alert(bg_ed);
	
	if (aoflg == 'of') {
		if ((bg_ico == ic_pl_of) || (bg_ico == '')) {
			ret = bg_st + ic_mi_of + bg_ed;
		} else {
			ret = bg_st + ic_pl_of + bg_ed;
		}
	}
	if (aoflg == 'ac') {
		if ((bg_ico == ic_pl_ac) || (bg_ico == '')) {
			ret = bg_st + ic_mi_ac + bg_ed;
		} else {
			ret = bg_st + ic_pl_ac + bg_ed;
		}
	}
	return ret;
}


/*******************************************
 ๆ๊Kw
*******************************************/
function v01_ac(id1, id2, id3){
	var ret1 = ic_yaji(id1, 'ac');
	if (document.getElementById(id1).style.background == '') {
		document.getElementById(id1).style.background = yajid_ac;
	} else {
		document.getElementById(id1).style.background = ret1;
	}


	var ret2 = ic_slice1(id2, 'ac');
	if (document.getElementById(id2).style.background == '') {
		document.getElementById(id2).style.background = minus1_ac;
	} else {
		document.getElementById(id2).style.background = ret2;
	}


	if ((document.getElementById(id3).style.display == '') || (document.getElementById(id3).style.display == "none")) {
		document.getElementById(id3).style.display = "block";
	} else {
		document.getElementById(id3).style.display = "none";
	}
}

function v01_of(id1, id2, id3){
	var ret1 = ic_yaji(id1, 'of');
	if (document.getElementById(id1).style.background == '') {
		document.getElementById(id1).style.background = yajid_of;
	} else {
		document.getElementById(id1).style.background = ret1;
	}


	var ret2 = ic_slice1(id2, 'of');
	if (document.getElementById(id2).style.background == '') {
		document.getElementById(id2).style.background = minus1_of;
	} else {
		document.getElementById(id2).style.background = ret2;
	}


	if ((document.getElementById(id3).style.display == '') || (document.getElementById(id3).style.display == "none")) {
		document.getElementById(id3).style.display = "block";
	} else {
		document.getElementById(id3).style.display = "none";
	}
}



/*******************************************
 ๆ๑Kw
*******************************************/
function v02_ac(id1, id2){
	var ret = ic_slice2(id1, 'ac');
	if (document.getElementById(id1).style.background == '') {
		document.getElementById(id1).style.background = minus_ac;
	} else {
		document.getElementById(id1).style.background = ret;
	}


	if ((document.getElementById(id2).style.display == '') || (document.getElementById(id2).style.display == "none")) {
		document.getElementById(id2).style.display = "block";
	} else {
		document.getElementById(id2).style.display = "none";
	}
}

function v02_of(id1, id2){
	var ret = ic_slice2(id1, 'of');
	if (document.getElementById(id1).style.background == '') {
		document.getElementById(id1).style.background = minus_of;
	} else {
		document.getElementById(id1).style.background = ret;
	}


	if ((document.getElementById(id2).style.display == '') || (document.getElementById(id2).style.display == "none")) {
		document.getElementById(id2).style.display = "block";
	} else {
		document.getElementById(id2).style.display = "none";
	}
}



/*******************************************
 ๆOKw
*******************************************/
function v03(id1, id2, id3){
	var ret1 = ic_yaji(id1, 'of');
	if (document.getElementById(id1).style.background == '') {
		document.getElementById(id1).style.background = yajid_of;
	} else {
		document.getElementById(id1).style.background = ret1;
	}


	var ret2 = ic_slice2(id2, 'of');
	if (document.getElementById(id2).style.background == '') {
		document.getElementById(id2).style.background = minus_of;
	} else {
		document.getElementById(id2).style.background = ret2;
	}


	if ((document.getElementById(id3).style.display == '') || (document.getElementById(id3).style.display == "none")) {
		document.getElementById(id3).style.display = "block";
	} else {
		document.getElementById(id3).style.display = "none";
	}
}

