﻿function getSclLeft() {
if ((navigator.appName.indexOf("Microsoft Internet Explorer",0) != -1)) {
return document.documentElement.scrollLeft;
} else if (window.pageXOffset) {
return window.pageXOffset;
} else {
return 0;
}
}

function getSclTop() {
if ((navigator.appName.indexOf("Microsoft Internet Explorer",0) != -1)) {
return document.documentElement.scrollTop;
} else if (window.pageYOffset) {
return window.pageYOffset;
} else {
return 0;
}
}

var SclTimer;
function PgScl(toX,toY,frms,cuX,cuY) {
if (SclTimer) clearTimeout(SclTimer);
if (!toX || toX < 0) toX = 0;
if (!toY || toY < 0) toY = 0;
if (!cuX) cuX = 0 + getSclLeft();
if (!cuY) cuY = 0 + getSclTop();
if (!frms) frms = 6;

if (toY > cuY && toY > (getAnchorPosObj('end','enddiv').y) - getInnerSize().height) toY = (getAnchorPosObj('end','enddiv').y - getInnerSize().height) + 1;
cuX += (toX - getSclLeft()) / frms; if (cuX < 0) cuX = 0;
cuY += (toY - getSclTop()) / frms;  if (cuY < 0) cuY = 0;
var posX = Math.floor(cuX);
var posY = Math.floor(cuY);
window.scrollTo(posX, posY);

if (posX != toX || posY != toY) {
SclTimer = setTimeout("PgScl("+toX+","+toY+","+frms+","+cuX+","+cuY+")",16);
}
}

function JumpPgTop() {
PgScl(0,0,5);
}


function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}


/* ---------------------------------------------------------------- */
/* NEWマーク表示処理                                                */
/* ---------------------------------------------------------------- */

function newMark(y,m,d)
{
	oldDay = new Date(y+"/"+m+"/"+d);
	newDay = new Date();
	n = (newDay - oldDay)/(1000*60*60*24);
	if (n <= 7) document.write("<span class='newico'>NEW</span>");
}

/* ---------------------------------------------------------------- */
/* 右クリック禁止処理                                               */
/* ---------------------------------------------------------------- */

function rightclick() {

	alert('右クリックできません');

}

/* ---------------------------------------------------------------- */
/* 西暦年　取得処理                                                 */
/* ---------------------------------------------------------------- */

function getYear() {
	
	mydate = new Date();
	myYear = mydate.getFullYear();

}

/* ---------------------------------------------------------------- */
/* エントリーフォーム　希望入社時期（年）表示                       */
/* ---------------------------------------------------------------- */

function initiationYear() {
	
	var Nensu = 6;
	getYear();

	for ( i = myYear ; i < myYear + Nensu ; i++ ) {
		document.write("<option value=\""+ i +"\">" + i + "</option>");
	}
	
}

/* ---------------------------------------------------------------- */
/* エントリーフォーム　卒業予定（年）表示                           */
/* ---------------------------------------------------------------- */

function graduationYear() {
	
	var Nensu = 38;
	getYear();
	var StartYear = 1970;
	var EndYear = myYear + 3;

	for ( i = StartYear ; i < EndYear ; i++ ) {
		document.write("<option value=\""+ i +"\">" + i + "</option>");
	}
	
}