if (typeof selfLocationOff=="undefined" && top.location!=self.location){ top.location=self.location; } function Evt(name) { document.cfn7.partext.value = name; document.cfn7.submit(); } function DispMsg(m){ if(m!=""){ window.alert(m); } } function OpenWin(url,name,w,h,l,t){ if (url!=""){ ParamText="" if (w!=""){ ParamText="width="+ w } if (h!=""){ if (ParamText!=""){ParamText=ParamText + ","} ParamText=ParamText+"height="+ h } if (l!=""){ if (ParamText!=""){ParamText=ParamText + ","} ParamText=ParamText+"left="+ l } if (t!=""){ if (ParamText!=""){ParamText=ParamText + ","} ParamText=ParamText+"top="+ t } window.open(url,name,ParamText); //window.open(url); //return false; } } function submitenter(myfield,e,action){ var keycode; if (window.event) keycode = window.event.keyCode; else if (e) keycode = e.which; else return true; if (keycode == 13){ document.cfn7.partext.value = action; document.cfn7.submit(); // myfield.form.submit(); return false; }else{ return true; } } function textCounter(theField,theCharCounter,maxChars) { var strCharCounter = 0; var str = document.forms[0].elements[theField].value; var len = str.length; var i; for(i = 0; i < len; i++){ n = escape(str.charAt(i)); if (n.length < 4) strCharCounter++; else strCharCounter+=2; } document.forms[0].elements[theCharCounter].value = strCharCounter; if (strCharCounter>maxChars ){ document.forms[0].elements[theCharCounter].style.color="red"; }else{ document.forms[0].elements[theCharCounter].style.color="black"; } } function OpenerReloadAndClose(s){ if(s!=""){ window.opener.focus(); window.opener.location.reload(); window.close(); } } function OpenerReloadAndSbClose(s){ if(s!=""){ //alert("enter!"); parent.location.reload(); // parent.Shadowbox.close(); } } function OnlyOne(a,b){ if(document.forms[0].elements[a][b].checked==true){ document.forms[0].elements[a][1-b].checked=false; } } function embedFlash(width, height, id, align, swf_name, bgcolor, param) { var allow_script_access; if(!swf_name.match('://')) allow_script_access= "sameDomain"; else if(swf_name.split('://')[1].split('/')[0]=='www.careerforum.net') allow_script_access= "sameDomain"; else allow_script_access= "always"; document.write('\n'); document.write(' \n'); document.write(' \n'); document.write(' \n'); document.write(' \n'); document.write(' \n'); document.write(' \n'); document.write('\n'); } function backToTop() { var x1 = x2 = x3 = 0; var y1 = y2 = y3 = 0; if (document.documentElement) { x1 = document.documentElement.scrollLeft || 0; y1 = document.documentElement.scrollTop || 0; } if (document.body) { x2 = document.body.scrollLeft || 0; y2 = document.body.scrollTop || 0; } x3 = window.scrollX || 0; y3 = window.scrollY || 0; var x = Math.max(x1, Math.max(x2, x3)); var y = Math.max(y1, Math.max(y2, y3)); window.scrollTo(Math.floor(x / 2), Math.floor(y / 2)); if (x > 0 || y > 0) { window.setTimeout("backToTop()", 25); } } function setElementClassById(elem, value) { if(document.getElementById) { var obj = document.getElementById(elem); if(obj) { obj.className = value; } } } function setCookie(name, val) { var tmp = name + "=" + escape(val) + "; "; tmp += "path=/; "; // tmp += "expires=Tue, 31-Dec-2030 23:59:59; "; document.cookie = tmp; } function getCookieVal(offset) { var endstr = document.cookie.indexOf (";", offset); if (endstr == -1) { endstr = document.cookie.length; } return unescape(document.cookie.substring(offset, endstr)); } function getCookie(name) { var arg = name + "="; var alen = arg.length; var clen = document.cookie.length; var i = 0; while (i < clen) { var j = i + alen; if (document.cookie.substring(i, j) == arg) return getCookieVal(j); i = document.cookie.indexOf(" ", i) + 1; if (i == 0) break; } return null; } function cssImport(File){ document.write(''); } function jsImport(File) { document.write(''); } // Job Bookmark : jQuery使用 function bookmark(str,lng){ if(str!=""){ //alert(str.substring(0,4)) var qStr="partext="+ str +"&lang="+ lng ; //alert(qStr); $('#bookmarkList').load('/inc/bookmark_ajax.inc.asp',qStr, function(response, status){ if(str.substring(0,4)=="Save"){ // alert(status) $('#bkmkMsg').html(status) $('#bkmkMsg').fadeIn(1000); $('#bkmkMsg').fadeOut(2000); } }); } } function insertAtCursor(text_area_id, insert_text){ message_area= document.getElementById(text_area_id); // for IE if (document.selection) { message_area.focus(); selected_text = document.selection.createRange(); selected_text.text = insert_text; } // for FireFox else if (message_area.selectionStart || message_area.selectionStart == '0') { var start_position = message_area.selectionStart; var end_position = message_area.selectionEnd; message_area.value = message_area.value.substring(0, start_position) + insert_text + message_area.value.substring(end_position, message_area.value.length); } else { message_area.value += insert_text; } } /****************************************************************************** 以下、タイムアウトカウンター用処理 これらを使用する場合、 フォーム 
内に 、 各入力フォームに onKeyUp="KeepAlive();"または onChange="KeepAlive();" を必ず入れること。 ******************************************************************************/ var myCntInit = 20*60; //sec. //var myCntInit = 20*60; //sec. var KeepAliveSec = myCntInit/2; //sec. var myCnt = myCntInit+1; function count(){ myCnt--; document.cfn7.timer.value = myCnt; AlertMsg1='Connection has been timed out. \n\nWhen you click on any of the buttons on the window, \nyou will be directed to the log-in page. Please log-in again.\n\n**Any information you have been editing on this page has not been saved.\nPlease copy and save this information before you move to the log-in window.'; // AlertMsg2='15分間アクションがありませんでした。あと5分弱で接続がタイムアウトになりますので、画面上のボタンを押すなどしてサーバとの接続を継続してください。'; if (myCnt == 0){ // 0秒になったか? alert(AlertMsg1); // }else if (myCnt == 300){ // 300秒(5分前)になったか? // // // var noticeWin=window.open("/system/5min_notice.asp?lang=","Notice","400","250"); // noticeWin.focus(); // setTimeout("count()",1000); // // alert(AlertMsg2); }else{ setTimeout("count()",1000); } } function KeepAlive() { myCnt = $F('timer'); if ((myCnt>0)&&(myCnt <= myCntInit-KeepAliveSec)){ var url = '/system/gettime.asp'; var pars = 'timer=' + $F('timer'); var myAjax = new Ajax.Request(url, { method: 'get', parameters: pars, onComplete: setTimer}); } } function KeepAliveJq() { myCnt = $('#timer').val(); if ((myCnt>0)&&(myCnt <= myCntInit-KeepAliveSec)){ var url = '/system/gettime.asp'; var pars = 'timer=' + myCnt ; // var myAjax = new Ajax.Request(url, { method: 'get', parameters: pars, onComplete: setTimer}); $.ajax({ type: "GET", url: url, data: pars }) .done(function() { setTimer(); }) } } function setTimer(req) { // $('LastServerTime').value = req.responseText; myCnt = myCntInit; } //******************************************************************************/ /* Web面接システム用 2010/11/19 Nonaka */ function Right(str, n){ var iLen = String(str).length; if (n > iLen) return str; else { return String(str).substring(iLen-n,iLen); } } function HhMmAmPm(hour,minute){ var ap = "am"; if(hour > 11){ap = "pm"; } if(hour > 12){hour = hour - 12;} if(hour == 0){hour = 12; } return hour +":"+ Right('0'+ minute,2) + ap ; } function convUTC2Local(targetTime){ var newTime =""; if (targetTime!=""){ var tTime = new Date(targetTime); TZAdjust= -1 * tTime.getTimezoneOffset(); tTime.setMinutes(tTime.getMinutes()+TZAdjust); newYear = tTime.getFullYear(); newMonth= tTime.getMonth()+1; newDate = tTime.getDate(); newHour = tTime.getHours(); newMin = tTime.getMinutes(); newTime =newYear +"/"+ Right('0'+newMonth,2)+"/"+ Right('0'+newDate,2)+" "+ Right('0'+newHour,2) +":"+ Right('0'+newMin,2); } return newTime; } function displayWIStime(t1,t2){ var dispTxt=""; var time1=new Date(t1); dispTxt+= Right('0'+(time1.getMonth()+1),2) +"/"+ Right('0'+time1.getDate(),2) +" "+ HhMmAmPm(time1.getHours(),time1.getMinutes()); if (t2 != ""){ var time2=new Date(t2); dispTxt+= " - "; if (time1.getDate()!= time2.getDate()){ dispTxt+= Right('0'+(time2.getMonth()+1),2) +"/"+ Right('0'+time2.getDate(),2)+ " "; } dispTxt+= HhMmAmPm(time2.getHours(),time2.getMinutes()); } return dispTxt; } function calendarPosition(targetTime){ var tTime = new Date(targetTime); var dispTxt="wk="+ tTime.getFullYear() +"-"+ (tTime.getMonth()+1) +"-"+ tTime.getDate(); dispTxt += "&scrl=" + 60 * 21 * tTime.getHours() / 10; return dispTxt; } function is_touch_device(){ return 'ontouchstart' in window || !!(navigator.msMaxTouchPoints); } function removeParam(key) { var sourceURL=document.location.href; var rtn = sourceURL.split("?")[0], param, params_arr = [], queryString = (sourceURL.indexOf("?") !== -1) ? sourceURL.split("?")[1] : ""; if (queryString !== "") { params_arr = queryString.split("&"); for (var i = params_arr.length - 1; i >= 0; i -= 1) { param = params_arr[i].split("=")[0]; if (param === key) { params_arr.splice(i, 1); } } rtn = rtn + "?" + params_arr.join("&"); } return rtn; } function isCanvasSupported(){ var elem = document.createElement('canvas'); return!!(elem.getContext && elem.getContext('2d')); } function removeRef(){ if (isCanvasSupported()){ // window.history.pushState(null,null,removeParam('ref')); window.history.replaceState({},null,removeParam('ref')); } } /* window.onload=removeRef; window.addEventListener('load', function (){ removeRef(); }); */ function addListener(event, obj, fn) { if (obj.addEventListener) { obj.addEventListener(event, fn, false); // modern browsers } else { obj.attachEvent("on"+event, fn); // older versions of IE } } addListener('load', window, removeRef);