// JavaScript Document


//ブックマークのためのJS
function addBookmark(title,url) {
    if (window.sidebar) {
         window.sidebar.addPanel(title, url,"");
 	   } else if( document.all ) {
         window.external.AddFavorite( url, title);
     } else if( window.opera && window.print ) {
         return true;
     }
 }

//info　マスコミ紹介ページの画像差し替え
function img(strImage){
	this.document.images['img1'].src = strImage;
}


//GE　resultページ　絞込検索のためのJS
function PageReLoad(URL_Plus) {
  var Frm = document.FrmMenu;
  Frm.action = 'result.asp';
  Frm.submit();
}

//エレベーターメニュー1

if ('undefined' == typeof this.pageYOffset) {
var d = (document.compatMode == 'CSS1Compat') ? 'documentElement' : 'body';
this.pageXOffset = function () { return document[d].scrollLeft; }
this.pageYOffset = function () { return document[d].scrollTop ; }
}

if ('undefined' == typeof this.addEventListener) {
this.addEventListener = new Function ('type', 'handler', 'capture', this.attachEvent ? "return this.attachEvent ('on' + type, handler);" : "this['on' + type] = function (oldHandler) { return function (e) { oldHandler && oldHandler (e); handler (e); } } (this['on' + type]);");
}

addEventListener ('load', function () {

function Timer (msec, handler) {
this.handler = handler;
this.timeOut = msec || 100;
this.timerID = null;
}

function Scheduler (handler) {
this.timerID = function (thisObj, callBack) { return setTimeout (function() { thisObj.handler (); callBack.call (thisObj); }, thisObj.timeOut); } (this, arguments.callee);
}

function Wrapper (node) {
this.target = node;
}

function Coordinater (dx, dy) {
var curX = parseInt (this.left) + dx;
var curY = parseInt (this.top) + dy;
this.left = (curX > 0 ? curX : 0) + 'px';
this.top = (curY > 0 ? curY : 0) + 'px';
}

function Escalator (delay) { /*@cc_on@*/
this.scrollDelay = delay;
this.scrollX = pageXOffset /*@if (@_jscript) () @end@*/;
this.scrollY = pageYOffset /*@if (@_jscript) () @end@*/;
}

function Synchronizer (output) { /*@cc_on@*/
var dx = Accelerater.call (this, pageXOffset /*@if (@_jscript) () @end@*/ - this.scrollX);
var dy = Accelerater.call (this, pageYOffset /*@if (@_jscript) () @end@*/ - this.scrollY);
this.scrollX += dx;
this.scrollY += dy;
output.call (this, dx, dy);
}
function Accelerater (dv) {
return (dv) ? Math.round (dv / Math.abs (dv) * (Math.abs (dv) / this.scrollDelay)) : 0;
}

function Initializer () {
this.style.position = 'absolute';
if (isNaN (parseInt (this.style.left))) this.style.left = this.offsetLeft + 'px';
if (isNaN (parseInt (this.style.top ))) this.style.top = this.offsetTop + 'px';
}

Escalator.prototype.init = function () {
return Initializer.apply (this.target, arguments);
}

Escalator.prototype.start = function () {
return Scheduler.apply (this, arguments);
}

Escalator.prototype.print = function () {
return Coordinater.apply (this.target.style, arguments);
}

Escalator.prototype.sync = function () {
return Synchronizer.call (this, function (dx, dy) { this.print (dx, dy); } );
}

Escalator.create = function (node, delay, msec) {
var e = new this (delay || 10);
Wrapper.call (e, node);
Timer.call (e, msec || 10, function () { e.sync (); } );
e.init ();
e.print (e.scrollX, e.scrollY);
e.start ();
return e;
}

Escalator.createById = function (id, delay, msec) {
var node = document.getElementById && document.getElementById(id);
return node ? this.create (node, delay, msec) : node;
}

Escalator.createById ('page-top');
Escalator.createById ('elmenu');
Escalator.createById ('elmenu2');

}, false);