/**
 * change_image
 * プロフィールの画像変更
 *
 */
function change_image(illust_id, illustrator_name_text, illustrator_id) {
	var elem = document.getElementsByName("profile_image")[0];
	var link_elem = document.getElementsByName("illustrator_name")[0];
	base_url = elem.src.substring(0, elem.src.lastIndexOf("/"));
	illustrator_url = link_elem.href.substring(0, link_elem.href.lastIndexOf("/"));
	elem.src = base_url + "/" + illust_id;
	link_elem.href = illustrator_url + "/" +  illustrator_id;
	if (navigator.userAgent.indexOf("Firefox") > -1) {
		link_elem.textContent = illustrator_name_text;
	}else{
		link_elem.innerText = illustrator_name_text;
	}
}


/**
 * change_voice
 * プロフィールのボイス変更
 *
 */
function change_voice(illust_id, illustrator_name_text, illustrator_id) {
	var link_elem = document.getElementsByName("actor_name")[0];
	illustrator_url = link_elem.href.substring(0, link_elem.href.lastIndexOf("/"));
	link_elem.href = illustrator_url + "/" +  illustrator_id;
	if (navigator.userAgent.indexOf("Firefox") > -1) {
		link_elem.textContent = illustrator_name_text;
	}else{
		link_elem.innerText = illustrator_name_text;
	}
}

/**
 * change_cut-in
 * 扉絵の画像変更
 *
 */
function change_cutin(illust_url, link_url) {
	var elem = document.getElementsByName("cutin_illust")[0];
	var link_elem = document.getElementsByName("cutin_link")[0];
	elem.src = illust_url;
	if (link_url != '') {
		link_elem.href = link_url;
	} else {
		link_elem.href = '#';
	}
}

/**
 * change_pilot_image
 * パイロットの画像変更
 *
 */
function change_pilot_image(illust_id, illustrator_name_text, illustrator_id) {
	var elem = document.getElementsByName("pilot_image")[0];
	var link_elem = document.getElementsByName("illustrator_name")[0];
	base_url = elem.src.substring(0, elem.src.lastIndexOf("/"));
	illustrator_url = link_elem.href.substring(0, link_elem.href.lastIndexOf("/"));
	elem.src = base_url + "/" + illust_id;
	link_elem.href = illustrator_url + "/" +  illustrator_id;
	if (navigator.userAgent.indexOf("Firefox") > -1) {
		link_elem.textContent = illustrator_name_text;
	}else{
		link_elem.innerText = illustrator_name_text;
	}
}

/**
 * change_pilot_voice
 * パイロットのボイス変更
 *
 */
function change_pilot_voice(illust_id, illustrator_name_text, illustrator_id) {
	var link_elem = document.getElementsByName("pilot_actor_name")[0];
	illustrator_url = link_elem.href.substring(0, link_elem.href.lastIndexOf("/"));
	link_elem.href = illustrator_url + "/" +  illustrator_id;
	if (navigator.userAgent.indexOf("Firefox") > -1) {
		link_elem.textContent = illustrator_name_text;
	}else{
		link_elem.innerText = illustrator_name_text;
	}
}

/**
 * change_robot_image
 * ロボットの画像変更
 *
 */
function change_robot_image(illust_id) {
	var elem = document.getElementsByName("robot_image")[0];
	base_url = elem.src.substring(0, elem.src.lastIndexOf("/"));
	elem.src = base_url + "/" + illust_id;
}

