function hpcodeTodr(){var space ="　";var zyusyo;var n=document.F1.sname.selectedIndex;if (field[n][3] !="9999999") {zyusyo=document.F1.sname.options[n].value.split(space);document.F2.address.value=zyusyo[0];document.F1.addr1.value=document.F1.sname.options[n].value;document.F1.hpname.value=document.F1.sname.options[n].text;document.F1.zip.value=field[n][2];document.F1.dcfcode.value=field[n][3];showAddress(document.F2.address.value);} else {document.F1.addr1.value=document.F1.otr_hpaddr1.value;}}function search(aRECID,aHPNAME) {if (aHPNAME=="") {document.F1.hpname.value="";}document.F1.addr1.value="";document.F1.search_zip.value=document.F1.zip.value;document.F1.search_recid.value=aRECID;if (document.F1.zip.value.length==7) {var searchWord='&fld=zip&code=' ;searchWord+=document.F1.zip.value ;searchWord+= '%';searchWord+='&recid=';searchWord+=aRECID;sendRequest(on_loaded,searchWord,'GET','../map-geocoding.php',true,true);} else {alert("郵便番号は７桁で入力して下さい");}}function on_loaded(oj) {var opt_len = document.F1.sname.options.length;for(i=0;i<opt_len-1;i++) {document.F1.sname.options[i].selected=false;}document.F1.sname.options[0].selected=true;var res=decodeURIComponent(oj.responseText);field=res.split("::") ;document.F1.sname.options.length=field.length-1;for(i=0;i<field.length-1;i++) {field[i]=field[i].split("||");document.F1.sname.options[i].text=field[i][0];document.F1.sname.options[i].value=field[i][1];if (document.F1.sname.options[i].text=="---") {document.F1.addr1.value="";alert ("郵便番号から施設を見つけることが出来ませんでした");break;}}}function hpname_select(aHpname) {var opt_len=document.F1.sname.options.length;for(i=0;i<opt_len-1;i++) {document.F1.sname.options[i].selected=false;if (document.F1.sname.options[i].text==aHpname) {document.F1.sname.options[i].selected=true;}}}