// IE6用のキャッシュ対策
try { 
	document.execCommand('BackgroundImageCache', false, true); 
} catch(e) {} 

function clearForm(target_form){
  for(i=0; i<target_form.elements.length; i++) {
    if(target_form.elements[i].type == "text") {
      target_form.elements[i].value = "";
    }
    if(target_form.elements[i].type == "select-one") {
      target_form.elements[i].selectedIndex = 0;
      target_form.elements[i].disabled = false;
    }
  }
}
function deleteCmd(id){
	document.delete_form.id.value = id;
	if( confirm('削除しますか？') ){
		document.delete_form.submit();
	}
}

/* ボタン動作 */
function btnAction(action)
{
	switch(action) {
		case "zip":
			if(document.input_form.zip.value.match(/^\d{3}-?\d{4}$/)) {
				document.input_form.action = "./contact.php";
				document.input_form.submit();
			}else{
				window.alert("7桁の郵便番号を入力してください");
			}
			break;
		case "check":
			document.input_form.action = "./check.php";
			document.input_form.submit();
			break;
		case "prev":
			document.check_form.action = "./contact.php";
			document.check_form.submit();
			break;
		default:
			document.check_form.action = "./send.php";
			document.check_form.submit();
			break;
	}
}

function redirect(action)
{
	location.href=action;
}

function changeActionSubmit(form_id, action)
{
    document.getElementById(form_id).action = action;
    document.getElementById(form_id).submit();
}

/* ボタン動作２(画像変更) */
function picChange(id,pic)
{
    document.getElementById(id).src = pic;
}

function openGooglemap()
{
	window.open('http://maps.google.co.jp/maps?f=q&hl=ja&geocode=&q=%E6%9D%B1%E4%BA%AC%E9%83%BD%E5%8D%83%E4%BB%A3%E7%94%B0%E5%8C%BA%E4%B9%9D%E6%AE%B5%E5%8D%973-9-11&ie=UTF8&z=16&iwloc=addr', 'google');
	
}
