chuC = 10; //一定時間内の画像最大数
curChu = 5; //最後の画像表示からの秒数
chuD = 700; //画像がスクリーンに止まる時間（ミリ秒数）
chuS = 50; //マウスと画像との位置
image = "common/js/animation.gif"; //画像のアドレス指定

//以下から変更不可
var docLayers = (document.layers) ? true:false;
var docId = (document.getElementById) ? true:false;
var docAll = (document.all) ? true:false;
var docbitK = (docLayers) ? "document.layers['":(docId) ? "document.getElementById('":(docAll) ? "document.all['":"document."
var docbitendK = (docLayers) ? "']":(docId) ? "')":(docAll) ? "']":""
var stylebitK = (docLayers) ? "":".style"
var showbitK = (docLayers) ? "show":"visible"
var hidebitK = (docLayers) ? "hide":"hidden"
var ns6=document.getElementById&&!document.all
//Variables used in script
var posX, posY, lastX, lastY, chuC, curChu, chuD, chuS, image
lastX = 0
lastY = 0
//Collection of functions to get mouse position and place the images
function dochu(e) {

posX = getMouseXPos(e)
posY = getMouseYPos(e)

if (posX>(lastX+chuS)||posX<(lastX-chuS)||posY>(lastY+chuS)||posY<(lastY-chuS)) {
showchu(posX,posY)
lastX = posX
lastY = posY
}
}

function getMouseXPos(e) {
if (document.layers||ns6) {
return parseInt(e.pageX+10)
} else {
return (parseInt(event.clientX+10) + parseInt(document.body.scrollLeft))
}
}

function getMouseYPos(e) {
if (document.layers||ns6) {
return parseInt(e.pageY)
} else {
return (parseInt(event.clientY) + parseInt(document.body.scrollTop))
}
}

function showchu(x,y) {
var processedx=ns6? Math.min(x,window.innerWidth-75) : docAll? Math.min(x,document.body.clientWidth-55) : x
if (curChu >= chuC) {curChu = 0; }
eval(docbitK + "chu" + curChu + docbitendK + stylebitK + '.left = "' + processedx + 'px";');
eval(docbitK + "chu" + curChu + docbitendK + stylebitK + '.top = "' + y + 'px";');
eval(docbitK + "chu" + curChu + docbitendK + stylebitK + ".visibility = '" + showbitK + "'");
if (eval("typeof(kissDelay" + curChu + ")")=="number") {
eval("clearTimeout(chuD" + curChu + ")")
}
eval("chuD" + curChu + " = setTimeout('hidechu(" + curChu + ")',chuD)")
curChu += 1
}

function hidechu(knum) {
eval(docbitK + "chu" + knum + docbitendK + stylebitK + ".visibility = '" + hidebitK + "'")
}

function chubegin(){

if (docLayers) {
document.captureEvents(Event.MOUSEMOVE)
document.onMouseMove = dochu
} else {
document.onmousemove = dochu
}
}
