//************************************************************************************** // showDown // 非公開(共通部品で使用します。) //************************************************************************************** function showDown(obj){ // obj.style.position = "relative"; // obj.style.left = "2px"; // obj.style.top = "2px"; } //************************************************************************************** // showUp // 非公開(共通部品で使用します。) //************************************************************************************** function showUp(obj){ // obj.style.position = "relative"; // obj.style.left = "0px"; // obj.style.top = "0px"; } //************************************************************************************** // GLOBAL変数定義 // 非公開(共通部品で使用します。) //************************************************************************************** var url = "JWNETAJServlet"; var xmlHttp = getHTTPObject(); //************************************************************************************** // getHTTPObject // 非公開(共通部品で使用します。) //************************************************************************************** function getHTTPObject() { var xmlhttp; if (window.ActiveXObject) try { xmlhttp = new ActiveXObject("Msxml2.XMLHTTP"); } catch (e) { try { xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); } catch (E) { xmlhttp = false; } } else{ xmlhttp = false; } if (!xmlhttp && typeof XMLHttpRequest != 'undefined') { try { xmlhttp = new XMLHttpRequest(); } catch (e) { xmlhttp = false; } } return xmlhttp; } var isWorking = false; //************************************************************************************** // getCity // Ajaxで市区町村プルダウンリストを生成します // 都道府県プルダウンのOnChangeに定義して下さい。 // -- pref 都道府県プルダウンのプロパティ名 // -- city 市区町村プルダウンのプロパティ名 //************************************************************************************** function getCity(pref, city) { var prefCode = window.document.forms[0].elements[pref].value; var formName = window.document.forms[0].name; if (prefCode.length == 2) { if (!isWorking && xmlHttp) { xmlHttp.open("POST", url, true); xmlHttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); xmlHttp.onreadystatechange = function() { handleHttpPulldownResponse(city); }; isWorking = true; xmlHttp.send("command=getCity&prefCode=" + escape(prefCode) + "&formName=" + formName + "&cityElem=" + city); } }else{ window.document.forms[0].elements[city].selectedIndex=0; window.document.forms[0].elements[city].length=1; } } //************************************************************************************** // getBlock // Ajaxで町域プルダウンリストを生成します // 市区町村プルダウンのOnChangeに定義して下さい。 // -- pref 都道府県プルダウンのプロパティ名 // -- city 市区町村プルダウンのプロパティ名 // -- block 町域のプルダウンのプロパティ名 //************************************************************************************** function getBlock(pref, city, block) { var prefCode = window.document.forms[0].elements[pref].value; var city = window.document.forms[0].elements[city].value; var formName = window.document.forms[0].name; if (prefCode.length == 2 && city != "") { if (!isWorking && xmlHttp) { xmlHttp.open("POST", url, true); xmlHttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); xmlHttp.onreadystatechange = function() { handleHttpPulldownResponse(block); }; isWorking = true; xmlHttp.send("command=getBlock&prefCode=" + escape(prefCode) + "&cityCode=" + escape(city) + "&formName=" + formName + "&blockElem=" + block); } }else{ window.document.forms[0].elements[block].selectedIndex=0; window.document.forms[0].elements[block].length=1; } } //************************************************************************************** // handleHttpPulldownResponse // 非公開(共通部品で使用します。) //************************************************************************************** function handleHttpPulldownResponse(block) { if (xmlHttp.readyState == 4 && xmlHttp.status == 200) { window.document.forms[0].elements[block].selectedIndex = 0; window.document.forms[0].elements[block].length = 0; if (xmlHttp.responseText.indexOf('NotFound') == -1) { var xmlDoc = xmlHttp.responseXML; var value = xmlDoc.getElementsByTagName('value'); var label = xmlDoc.getElementsByTagName('label'); if ((value) && (value.length)) { window.document.forms[0].elements[block].length = value.length; for ( var i = 0; i < value.length; i++) { if (value.item(i).firstChild) { window.document.forms[0].elements[block].options[i].value = value .item(i).firstChild.data; }else{ window.document.forms[0].elements[block].options[i].value = ""; } if (label.item(i).firstChild) { window.document.forms[0].elements[block].options[i].text = label .item(i).firstChild.data; }else{ window.document.forms[0].elements[block].options[i].text = ""; } } } } if(window.document.forms[0].elements[block].onchange){ window.document.forms[0].elements[block].onchange(); } } isWorking = false; } //************************************************************************************** // showCal_startJW // -- name 日付をセットするテキストフィールドのプロパティ名 //************************************************************************************** function showCal_startJW(name){ resetCursor(this); wrtCalendar(window.document.forms[0].elements[name],window.event); } //************************************************************************************** //openAllMenuDivTags //表示・非表示を切り替えられるメニューdivタグを全て表示状態にします。 //************************************************************************************** function openAllMenuDivTags() { try{ if ( tmenu ) { var divTags = document.forms[0].getElementsByTagName("div"); for ( var i = 0 ; i < divTags.length ; i++ ) { if ( divTags[i].id.substring( 0, 4 ) == tmenu.idName ) { var menuNo = eval( divTags[i].id.substring( 4 ) ); if ( divTags[i].style.display == "none" ) { toggleNoSave( menuNo ); } } } } } catch ( e ) { ; } } //************************************************************************************** //toggleNoSave //非公開(共通部品で使用します。) //************************************************************************************** function toggleNoSave( n ) { var expanded; var state = ""; cStatus = tmenu.getCookie(cookieName); if ((cStatus == null) || (cStatus == "null")) cStatus = initStatus; if (!cStatus) { expanded = 0; } else { expanded = cStatus.charAt(n); } if (expanded == 0) { document.getElementById(tmenu.idName + n).style.display = "block"; document.images[tmenu.imageName + n].src = tmenu.collapsedImage; } else { document.getElementById(tmenu.idName + n).style.display = "none"; document.images[tmenu.imageName + n].src = tmenu.expandedImage; } } //************************************************************************************** //saveMenuOpenCookie //メニューdivタグをすべて表示状態でCookieに保存します。 //************************************************************************************** function saveMenuOpenCookie() { try{ if ( tmenu ) { var divTags = document.forms[0].getElementsByTagName("div"); var state = ""; for ( var i = 0 ; i < divTags.length ; i++ ) { if ( divTags[i].id.substring( 0, 4 ) == tmenu.idName ) { state += "1"; } } tmenu.setCookie( cookieName, state ); } }catch( e ) { ; } }