/* ' ########################################################### ' TT-net common.js ' Create 2012.11.22 Kawasaki ' Modyfy ----.--.-- -------- ' ########################################################### */ // require jQuery base document.write(''); // require jQuery Migrate document.write(''); // require for Vertical Menu document.write(''); document.write(''); // require for Vertical Menu Scroll document.write(''); // jQuery ToolTip document.write(''); // common document.write(''); // Google Analytics → 2015/08/04 グループサイトとのUA化に伴いコメント化 // document.write(''); // 2017/03/30 FCS Add Start ◆セキュリティ対応◆ document.write(''); document.write(''); // 2017/03/30 FCS Add End ◆セキュリティ対応◆ document.write(''); document.write(''); // ----------------------------------------------------------- // GA - PDF COUNT → 2015/08/04 グループサイトとのUA化に伴いコメント化 function TrackPdfEtc( obj) { // if( typeof( _gaq) != "undefined"){ // var sUrl = obj.href; // var sHref = $( obj).attr( "href"); // if( typeof( sHref) == "undefined"){ return;} // if( sHref.match( /.+\.pdf$/)){ // var sp = sUrl.split("/"); // var script_name = ''; // for( var i = 0; i < sp.length; i++) { // if( i > 2){ // script_name += '/' + sp[i]; // } // } // if( script_name != '') { // _gaq.push(['_trackPageview', script_name]); // } // } // } } // GA - PDF COUNT // ----------------------------------------------------------- // ----------------------------------------------------------- // product list // open/close button - sw toggle function OpnClsFig(objId){ var oTmp = document.getElementById(objId); if ((oTmp.style.display == "") || (oTmp.style.display == "none")){ //if (oTmp.style.display == "none"){ OpnFig(objId); }else{ ClsFig(objId); } } // open/close button - sw open function OpnFig(objId){ var imgId = "btn" + objId; if( document.getElementById(objId) != null) { document.getElementById(objId).style.display = "block"; //document.getElementById(objId).style.display = ""; } if( document.getElementById(imgId) != null) { document.getElementById(imgId).src = "/tecs/img/btn_ListClose.gif"; } } // open/close button - sw close function ClsFig(objId){ var imgId = "btn" + objId; if( document.getElementById(objId) != null) { document.getElementById(objId).style.display = "none"; } if( document.getElementById(imgId) != null) { document.getElementById(imgId).src = "/tecs/img/btn_ListOpen.gif"; } } // link to product detail function DispData(cGroup, cSeries, cKata, cMode) { OpenUrl = "/tecs/pdct" + cGroup + "/pdct_Dtl_" + cSeries + ".asp"; if ( cKata != ''){ OpenUrl += "?kata=" + encodeURI( cKata); } if (cMode == 'New'){ window.open(OpenUrl); }else if (cMode == 'Opener'){ window.opener.location.href = OpenUrl; window.close(); }else{ location.href = OpenUrl; } } // ↓ ADD DSK T.Honda - 2019/5/30 // link to product detail function DispData_pkg(cGroup, cSeries, cKata, cPkg, cMode) { var first = true; OpenUrl = "/tecs/pdct" + cGroup + "/pdct_Dtl_" + cSeries + ".asp"; if ( cKata != ''){ OpenUrl += "?kata=" + encodeURI( cKata); first = false; } if ( cPkg != '') { if (first) { OpenUrl += "?pkg=" + encodeURI( cPkg); } else { OpenUrl += "&pkg=" + encodeURI( cPkg); } } if (cMode == 'New'){ window.open(OpenUrl); }else if (cMode == 'Opener'){ window.opener.location.href = OpenUrl; window.close(); }else{ location.href = OpenUrl; } } // ↑ ADD DSK T.Honda - 2019/5/30 // ↓ ADD DSK M.I - 2018/03/08 // link to model number navigation function DispData_ktnv(cGroup, cSeries, cParam, cMode) { var objWin; OpenUrl = "/tecs/pdfl" + cGroup + "/pdfl_Dtl_" + cSeries + ".asp"; if ( cParam != ''){ OpenUrl += "?" + encodeURI( cParam); } if (cMode == 'New'){ objWin = window.open(OpenUrl, 'ktnv_' + cSeries); objWin.focus(); }else if (cMode == 'Opener'){ window.opener.location.href = OpenUrl; window.close(); }else{ location.href = OpenUrl; } } // link to PDF Drawing function DispPDF(cGroup, cSeries, cParam, cMode) { var objWin; OpenUrl = "/tecs/pdfl" + cGroup + "/pdfl_Disp_" + cSeries + ".asp"; if ( cParam != ''){ OpenUrl += "?" + encodeURI( cParam); } if (cMode == 'New'){ objWin = window.open(OpenUrl, 'ktnv_' + cSeries); objWin.focus(); }else if (cMode == 'Opener'){ window.opener.location.href = OpenUrl; window.close(); }else{ location.href = OpenUrl; } } // ↑ ADD DSK M.I - 2018/03/08 // ↓ ADD DSK T.Honda - 2019/6/11 function DownloadZumen(bu, uniqueNo, linksu, ryotan) { var objWin; if (bu == "spr") { OpenUrl = "/tecs/pdfl/spr/Prepare.asp?kubun=P&kata=" + encodeURIComponent(uniqueNo); } else if (bu == "tpl") { OpenUrl = "/tecs/pdfl/tpl/Prepare.asp?kubun=P&kata=" + encodeURIComponent(uniqueNo); } else { OpenUrl = "/tecs/pdfl/cdc/Prepare.asp?bu=" + encodeURIComponent(bu) + "&kataban=" + encodeURIComponent(uniqueNo) + "&linksu=" + encodeURIComponent(linksu) + "&ryotan=" + encodeURIComponent(ryotan); } objWin = window.open(OpenUrl, '_blank'); // objWin = window.open(OpenUrl, 'Prepare'); objWin.focus(); } // ↑ ADD DSK T.Honda - 2019/6/11 // SelectMenu - Delete Options Value // obj:Input=select(Form Name) function InitSelMenu( obj) { var i; var len = obj.options.length; for (i=len-1; i>=0; i--) { obj.options[i] = null; } } // class="setwd"で決めた幅もしくはtableの幅に調整するipop function PopupSetwdTbl( e){ var x = e.pageX; // クリック地点のX座標 var y = e.pageY; // クリック地点のY座標 var sFeatId = $(this).attr( "id"); // クリックしたオブジェクトのidを取得 var sPopupId = "pup" + sFeatId; // ポップアップするdivのidを設定 // 右にある場合は左に表示する if( x > 690 ){ x -= 340; } // ポップアップ実行 $.ipop( "#" + sPopupId, x, y); // 以下、ポップアップの幅を調整 var min_ipopwidth = 200; // ipop最小幅px var tcnt; // テーブル個数用変数 var twidth; // テーブル幅用変数 var osetwd; // ipop内の幅設定classを持つ要素 var divwidth; // ipop内の幅設定classを持つ要素の幅 // 初期化 divwidth = 0; // ipop内に幅設定class="setwd"を持つ要素があれば幅を取得 if($( "#" + sPopupId).find(".setwd").length){ osetwd = $( "#" + sPopupId).find(".setwd"); divwidth = osetwd.width() + parseInt(osetwd.css('margin-left'), 10) // 左マージンを取得して加算 + parseInt(osetwd.css('margin-right'), 10) // 右マージンを取得して加算 + parseInt(osetwd.css('padding-left'), 10) // 左パディングを取得して加算 + parseInt(osetwd.css('padding-right'), 10); // 右パディングを取得して加算 } // 幅設定が有ればセット if (min_ipopwidth < divwidth){ min_ipopwidth = divwidth; } // ipop内のテーブル数を取得(ループ回数) tcnt = $( "#" + sPopupId).find("table").length; //alert(tcnt); // 幅設定より幅が広いテーブルが有ればセット for(let i=0; i < tcnt; i++) { twidth = $( "#" + sPopupId).find("table:eq(" + i + ")").width() + 50; // alert(twidth); if (min_ipopwidth < twidth){ min_ipopwidth = twidth; } } // ポップアップの幅を変更 $( "#" + sPopupId).css("width", min_ipopwidth + "px"); } // table作成後に不要な行を消し、隣のセルと値が同じ場合は結合する // 削除する条件:tdに「‐」しかない場合に行を非表示にする function TableEdit1(sId){ var trCnt = $( "#" + sId).find("tr").length; //対象id内のtrタグ数を取得(ループ回数) var tdCnt; //対象id内のtdタグ数 var flg_none; //1の場合trを非表示にする。 var tdval; //tdの値 var thRowspan; //thのrowspan for(let i=0;i < trCnt; i++){ flg_none ="1"; var tdCnt = $( "#" + sId).find("tr:eq(" + i + ")").find("td").length; if(tdCnt > 0){ for(let j=0;j < tdCnt; j++){ tdval = $( "#" + sId).find("tr:eq(" + i + ")").find("td:eq(" + j + ")").text(); if (tdval != "-") { flg_none = "0"; break; } } if (flg_none == "1"){ if($( "#" + sId).find("tr:eq(" + i + ")").find("th").length == 0){ //th要素が無いので上位のtr要素のrowspanを-1する thRowspan = $( "#" + sId).find("tr:eq(" + (i - 1) + ")").find("th").attr("rowspan"); $( "#" + sId).find("tr:eq(" + (i - 1) + ")").find("th").attr("rowspan",thRowspan - 1); } $( "#" + sId).find("tr:eq(" + i + ")").css("display","none"); } } } } // product list // ----------------------------------------------------------- // ----------------------------------------------------------- // okiniiri // display switch ON - menu_h function DispOnSPI() { var obj; if ( document.getElementById("savepageinfo") != null) { obj = document.getElementById("savepageinfo"); if ( obj.style.display == "none") { obj.style.display = ""; } else { obj.style.display = "none"; } } } // display switch OFF - menu_h function DispOffSPI() { var obj; if ( document.getElementById("savepageinfo") != null) { obj = document.getElementById("savepageinfo"); obj.style.display = "none"; } } // okiniiri // ----------------------------------------------------------- // ----------------------------------------------------------- // alert function PopupInqr(){ alert('このデータについてはお問合せください。'); } function PopupNoukiNote(){ alert('納期は諸事情により変動することがあります。\nご発注時には必ずご確認ください。'); } // alert // ----------------------------------------------------------- // ----------------------------------------------------------- // scroll function WinScroll( sid){ // alert($( '#header').height()); // alert($( sid).position().top); // window.scroll( 0, $( sid).position().top - $( '#header').height() - 5); // 5:margin // $("html, body").animate({scrollTop:$( sid).position().top - $( '#header').height() - 5}, 100, "swing"); $("html, body").animate({scrollTop:$( sid).position().top - $( '#header').height() - $( '#header_s').height() - 3}, 100, "linear"); } function WinScroll4ctlg( sid){ // check exist if ( $( sid).get( 0)) { // exist OK window.scroll( 0, $( sid).position().top - $( '#header').height() - 5); // 5:margin } else { // exist NG var scode = ""; switch (sid.substr(sid.indexOf("=") + 1, 3)){ case "cdc": scode = "10_10_a"; break; case "csc": scode = "10_10_b"; break; case "clc": scode = "10_10_c"; break; case "ctc": scode = "10_10_d"; break; case "spr": scode = "10_50"; break; case "ccv": scode = "10_60"; break; case "tbl": scode = "10_70"; // scode = "10_70_a"; break; case "tpl": scode = "10_70"; // scode = "10_70_b"; break; case "gen": scode = "10_90"; break; case "sad": scode = "10_120"; break; case "kpl": scode = "10_100"; break; case "kcp": scode = "10_110"; break; case "kds": scode = "10_150"; break; case "kkf": scode = "10_140"; break; case "clu": scode = "10_130"; break; case "lft": scode = "10_250"; break; case "hsu": scode = "10_300"; break; } location.href='/tecs/ctlg/ctlg_clist.asp?bu_code=' + scode; } } function WinScroll4mnul( sid){ // check exist if ( $( sid).get( 0)) { // exist OK window.scroll( 0, $( sid).position().top - $( '#header').height() - 5); // 5:margin } else { // exist NG var scode = ""; switch (sid.substr(sid.indexOf("=") + 1, 3)){ case "cdc": scode = "10_10_a"; break; case "csc": scode = "10_10_b"; break; case "clc": scode = "10_10_c"; break; case "ctc": scode = "10_10_d"; break; case "spr": scode = "10_50"; break; case "ccv": scode = "10_60"; break; case "tbl": scode = "10_70"; // scode = "10_70_a"; break; case "tpl": scode = "10_70"; // scode = "10_70_b"; break; case "gen": scode = "10_90"; break; case "sad": scode = "10_120"; break; case "kpl": scode = "10_100"; break; case "kcp": scode = "10_110"; break; case "kds": scode = "10_150"; break; case "kkf": scode = "10_140"; break; case "clu": scode = "10_130"; break; case "lft": scode = "10_250"; break; case "hsu": scode = "10_300"; break; } location.href='/tecs/ctlg/ctlg_mlist.asp?bu_code=' + scode; } } // 'URLのハッシュid部分へスクロールする function ScrollToID(){ // URLのアンカー(#以降の部分)を取得 var urlHash = location.hash; if(urlHash){ // // アンカーが#tabareaかどうかを判断する // if (urlHash == '#tabarea') { WinScroll( urlHash); // WinScroll( '#tabarea'); // } } } // scroll // ----------------------------------------------------------- // pdct tabs count and heightline -- ota add 2020.5.21 - 22 -- // --- [履歴] qadaでだけイベントが発火しない // --- >>> window.onloadをwindow.addEventListener('load',...に変更 // --- >>> タブ幅が揃う前に一瞬元の幅で表示されるのを解消するため // --- 'load'を'DOMContentLoaded'...に変更 window.addEventListener('DOMContentLoaded', function () { var tabNum = $('ul.tabs li').length; var tabWidth = $('ul.tabs').width(); var tabHeight = $('ul.tabs li').height(); var maxHeight = 0; var tabNum2 = $('ul.tabs2 li').length; var tabWidth2 = $('ul.tabs2').width(); var tabHeight2 = $('ul.tabs2 li').height(); var maxHeight2 = 0; var userAgent = window.navigator.userAgent.toLowerCase(); if (tabNum == 1) { $('ul.tabs').css('display','none') } else { $('ul.tabs li').each(function () { if (tabHeight > maxHeight) { maxHeight = tabHeight; } }); $('ul.tabs li').width(tabWidth / tabNum); if( userAgent.match(/(msie|MSIE)/) || userAgent.match(/(T|t)rident/) ) { $('ul.tabs').css('height','auto'); } } if (tabNum2 == 1) { $('ul.tabs2').css('display','none') } else { $('ul.tabs2 li').each(function () { if (tabHeight2 > maxHeight2) { maxHeight2 = tabHeight2; } }); $('ul.tabs2 li').width(tabWidth2 / tabNum2); if( userAgent.match(/(msie|MSIE)/) || userAgent.match(/(T|t)rident/) ) { $('ul.tabs2').css('height','auto'); } } // --- フッターのないページにクッキー設定アイコン分の余白を付与する if ($('.c-footer').length == 0) { $('#content').css('margin-bottom','70px'); } // --- ヘッダーでページリンクがずれる際の対処 var headerHight = $("#header").height(); $('a[href^=#]').click(function(){ var href= $(this).attr("href"); var target = $(href == "#" || href == "" ? 'html' : href); var position = target.offset().top-headerHight-5; // $("html, body").animate({scrollTop:position}, 600, "swing"); $("html, body").animate({scrollTop:position}, 100, "linear"); return false; }); // --- 検索窓の開閉 $('#toggleSrch').on('click', function() { $('.addsearch').animate({"width":"toggle"}); }); // --- 言語切り替えボタンの開閉 $('#language').on('click', function() { $('.lang-list').toggleClass('list-open'); $('.lang-code').toggleClass('code-open'); }); $('#content h3').after('
'); $('#content h4').after('
'); // --- オンライン技術相談開閉ボタン $('#onlnBtn').on('click', function() { $('#onlnInqInnr').toggleClass('d_block'); $('#onlnBtn').toggleClass('onln_start'); $('.onln-inqr-box-arrow').toggleClass('after'); }); }) function LoginAlert(type, clkobj, kata) //type:zumen,dxf,3dcad { Swal.fire({ icon: 'info', title: 'PDF外形図の表示またはCADデータをダウンロードしていただく場合、ユーザー登録をお願いしています。', text: '次のページでログインまたは新規登録していただきますと、表示中のページのリンクが有効になります。', allowOutsideClick : false, //枠外クリックは許可しない allowEscapeKey : false, //escも許可しない showCancelButton : true, confirmButtonText : '次へ', cancelButtonText : '戻る', reverseButtons : true, confirmButtonColor : '#09f', width : '490px', padding : '3rem' }).then((result) => { if(result.isConfirmed == true){ // alert(clkobj.id); sessionStorage.removeItem("clk"); sessionStorage.setItem("clk", clkobj.id); //window.location.href = '/tecs/usr/usr_login.asp'; document.ZumenLogin.next.value = "Y"; document.ZumenLogin.submit(); }else{ //ログだけ書き込む switch (type){ case 'zumen': $.post( "/tecs/write_log.asp" , { type:type ,skata: kata ,ref: location.href ,succes:"戻るボタン押下" } ); break; case 'dxf': $.post( "/tecs/write_log.asp" , { type:type ,skata: kata ,ref: location.href ,succes:"戻るボタン押下" } ); break; case '3dcad': $.post( "/tecs/write_log.asp" , { type:type ,skata: kata ,ref: location.href ,succes:"戻るボタン押下" } ); break; } } }); } function DLdxf(kata,link) //dxfのダウンロード時にログを書き込む { $.post( "/tecs/write_log.asp" , { type:"dxf" ,skata: kata ,ref: location.href ,succes:"成功" } ); window.open(link, '_blank'); } function DLcaddata(kata,link) //3dcadの遷移時にログを書き込む { $.post( "/tecs/write_log.asp" , { type:"3dcad" ,skata: kata ,ref: location.href ,succes:"成功" } ); window.open(link, '_blank'); } function DLzumen(kata,link) //図面(直リンク)のダウンロード時にログを書き込む { $.post( "/tecs/write_log.asp" , { type:"zumen" ,skata: kata ,ref: location.href ,succes:"成功" } ); window.open(link, '_blank'); } function DataClk(){ if(sessionStorage.getItem("clk")){ if("" != "") { var clkid = sessionStorage.getItem("clk"); $('#'+clkid)[0].click(); } } //onloadのダウンロードは1回のみ実行する sessionStorage.removeItem("clk"); } function SubmitFormDXF_C(skata){ document.DownloadDXF_C.kata.value = skata; document.DownloadDXF_C.submit(); } function SubmitForm3D_C(skata){ document.Open3DLink_C.kata.value = skata; document.Open3DLink_C.submit(); } function SetFavorite(url,kata,mode){ $.post( "/tecs/insert_favorite.asp" , { mode:mode ,url: url ,kata: kata } ); alert("保存しました") } //お気に入り登録AJAX処理 function regist_o( url) { $.post( "/tecs/favorite_list.asp" , { mode:"regist_favorite" ,url:url , key:" " } , function( data){ $.post( "/tecs/favorite_list.asp" , { mode:"get_favorite" , key:" " } , function( data){ eval(data); $("#spi_o_list").children().remove(); if(Object.keys(arrList).length == "1"){ $("#spi_o_list").append("×保存されているお気に入りページはありません。"); }else{ $("#spi_o_list").append('現在お気に入りに登録されているページ'); for(let i = 1 ; i < Object.keys(arrList).length; i++){ $('#spi_o_list').append('' + i + '. ' + arrList[i]["uri"] + ''); } } $("#spi_s_list").children().remove(); if(Object.keys(arrList_s).length == "1"){ $("#spi_s_list").append("×保存されている採用検討中製品はありません。"); }else{ $("#spi_s_list").append('現在採用検討中に登録されているページ'); for(let i = 1 ; i < Object.keys(arrList_s).length; i++){ $('#spi_s_list').append('' + i + '. ' + arrList_s[i]["uri"] + ''); } } } ); } ); } //採用検討中登録AJAX処理 function regist_s( url) { $.post( "/tecs/favorite_list.asp" , { mode:"regist_adopt" ,url:url , key:" " } , function( data){ $.post( "/tecs/favorite_list.asp" , { mode:"get_favorite" , key:" " } , function( data){ eval(data); $("#spi_o_list").children().remove(); if(Object.keys(arrList).length == "1"){ $("#spi_o_list").append("×保存されているお気に入りページはありません。"); }else{ $("#spi_o_list").append('現在お気に入りに登録されているページ'); for(let i = 1 ; i < Object.keys(arrList).length; i++){ $('#spi_o_list').append('' + i + '. ' + arrList[i]["uri"] + ''); } } $("#spi_s_list").children().remove(); if(Object.keys(arrList_s).length == "1"){ $("#spi_s_list").append("×保存されている採用検討中製品はありません。"); }else{ $("#spi_s_list").append('現在採用検討中に登録されているページ'); for(let i = 1 ; i < Object.keys(arrList_s).length; i++){ $('#spi_s_list').append('' + i + '. ' + arrList_s[i]["uri"] + ''); } } } ); } ); }