function add_alert() { if (confirm("追加してよろしいですか？")){ return true; }else{ return false; } }
function chg_alert() { if (confirm("更新してよろしいですか？")){ return true; }else{ return false; } }
function del_alert(){ if (confirm("削除してよろしいですか？")){ return true; }else{ return false; } }
function msg_alert(msg){ if (confirm(msg)){ return true; }else{ return false; } }
function cache_rand(){ now = new Date(); cache_time = new Date(now.getYear(),now.getMonth(),now.getDay()); return cache_time.getTime(); }
function menu_chg(id, pic){  document.getElementById(id).src = pic+'?'+cache_rand(); }
try{ document.execCommand('BackgroundImageCache', false, true); } catch(e) {}
function iphoneSwitch(){
	if(GetCookie("iphoneSwitch")){ DeleteCookie("iphoneSwitch"); }else{ SetCookie("iphoneSwitch", "1"); }
	window.location.reload();
}

function chg_search(v, t) {
	document.header_search.searchbox_value.value = v;
	document.getElementById("searchbox").style.color = "black";
	for (i = 0; i < t.parentNode.childNodes.length; i++) {
		if (t.parentNode.childNodes[i].nodeName == "SPAN") {
			t.parentNode.childNodes[i].style.color = "black";
		}
	}
	t.style.color = "red";
}
