function RegionProp(areaField, countryField, selectedArea, selectedCountry) { this.areaField = areaField; this.countryField = countryField; this.selectedArea = selectedArea; this.selectedCountry = selectedCountry; } var area = new Object(); area["01"] = "ヨーロッパ"; area["02"] = "アフリカ"; area["03"] = "中東"; area["04"] = "アジア"; area["05"] = "北アメリカ"; area["06"] = "南アメリカ"; area["07"] = "オセアニア"; var country = new Object(); country["01"] = new Array( "00001::アイルランド" ,"00002::イタリア" ,"00003::オーストリア" ,"00004::オランダ" ,"00005::ギリシャ" ,"00006::スイス" ,"00007::スウェーデン" ,"00008::スペイン" ,"00009::デンマーク" ,"00010::ドイツ" ,"00011::ノルウェー" ,"00012::フィンランド" ,"00013::フランス" ,"00014::ブルガリア" ,"00015::ベルギー" ,"00016::ポーランド" ,"00017::ポルトガル" ,"00018::ルーマニア" ,"00019::ロシア" ,"00020::イギリス" ); country["02"] = new Array( "00021::エジプト" ,"00022::南アフリカ共和国" ); country["03"] = new Array( "00023::アラブ首長国連邦" ,"00024::イスラエル" ,"00025::クウェート" ,"00026::サウジアラビア" ,"00027::トルコ" ,"00028::バーレーン" ); country["04"] = new Array( "00029::インド" ,"00030::インドネシア" ,"00031::シンガポール" ,"00032::タイ" ,"00033::大韓民国" ,"00034::中華人民共和国" ,"00035::日本" ,"00036::マレーシア" ,"00037::ブルネイ・ダルサラーム" ,"00038::中華民国" ); country["05"] = new Array( "00039::アメリカ合衆国" ,"00040::カナダ" ); country["06"] = new Array( "00041::メキシコ" ,"00042::ベネズエラ" ,"00043::アルゼンチン" ,"00044::チリ" ,"00045::ブラジル" ,"00046::ペルー" ); country["07"] = new Array( "00047::オーストラリア" ,"00048::ニュージーランド" ); function $(id) { return document.getElementById(id); } function initArea(e, prop) { var selectedArea = ""; if (prop.selectedArea) { selectedArea = prop.selectedArea; } if (prop.selectedCountry) { for (key in country) { for (var i = 0; i < country[key].length; i++) { var data = country[key][i].split("::"); if (data[0] == prop.selectedCountry) { selectedArea = key; } } } } while ($(prop.areaField).hasChildNodes ()) $(prop.areaField).removeChild ($(prop.areaField).firstChild); var option = document.createElement ('option'); option.value = ''; option.appendChild (document.createTextNode ('-- 選択してください --')); $(prop.areaField).appendChild (option); for (key in area) { var option = document.createElement ('option'); option.value = key; if (key == selectedArea) { option.setAttribute("selected", "selected"); //option.selected = true; } option.appendChild (document.createTextNode (area[key])); $(prop.areaField).appendChild (option); } area_onChange(prop.areaField, prop.countryField, prop.selectedCountry); } function area_onChange(areaField, countryField, selectedCountry) { while ($(countryField).hasChildNodes ()) $(countryField).removeChild ($(countryField).firstChild); var key = $(areaField).options[$(areaField).selectedIndex].value; var option = document.createElement ('option'); option.value = ''; option.appendChild (document.createTextNode ('-- 選択してください --')); $(countryField).appendChild (option); if (key) { for (var i = 0; i < country[key].length; i++) { var data = country[key][i].split("::"); var option = document.createElement ('option'); option.value = data[0]; if (data[0] == selectedCountry) { option.setAttribute("selected", "selected"); //option.selected = true; } option.appendChild (document.createTextNode (data[1])); $(countryField).appendChild (option); } } } function country_onChange(areaField, countryField) { } // サブウインドウオープン function subWindow(url, name, width, height) { var attr = "toolbar=no,location=no,directories=no,status=yes,menubar=no,scrollbars=yes,resizable=yes,width=" + width + ",height=" + height; return window.open(url, name, attr); }