/* ページスクロール用
------------------------------------------------------------ */

function pageup(e) {
UAGENT = navigator.userAgent.toUpperCase();
if (UAGENT.indexOf("MSIE") >=0) { posi = event.y; }
else { posi = e.pageY; }
moveObje(posi);
}

function moveObje(position) {
move = position / 2;
point = parseInt(position - move);
scrollTo(0,point);
if (point > 0) { setTimeout("moveObje(point)",2); }
}


/* 別ウィンドゥでブラウザを開く
------------------------------------------------------------ */

window.onload = function() {
var node_a = document.getElementsByTagName('a');
for (var i in node_a) {
if (node_a[i].className == 'newwin') {
node_a[i].onclick = function() {
window.open(this.href, '', '');
return false;
};
}
}
};

/* マップのロールオーバー
------------------------------------------------------------ */
function changeMapImage(num) {
	var bs = 'img/top/';
	var fn = 'tsuken_top_';
	var ft = '.gif';

	if(document.getElementById){
		t = document.getElementById('top_visual');
	}else{
		t = document.all('top_visual');
	}
	
	t.src = bs+fn+num+ft;
}

/* ロールオーバー上書き関数
------------------------------------------------------------ */
function setMapChange(img){
    if(nums = img.id.match(/\d{2}$/)){
        if(nums > 1 && nums < 7){
            img.onmouseover = function(){
                nums = this.id.match(/\d{2}$/);
                changeMapImage(nums);
                this.setAttribute("src", this.getAttribute("src").replace("_n.", "_o."));
            }
            img.onmouseout = function() {   
                this.setAttribute("src", this.getAttribute("src").replace("_o.", "_n."));
                changeMapImage('01');
            }
        }         
    }
}


/* ロールオーバー
2010/12/15 modify tsu@cafeign.com add function setMapChange;
------------------------------------------------------------ */

function smartRollover() {   
    if(document.getElementsByTagName) {   
        var images = document.getElementsByTagName("img");   
        for(var i=0; i < images.length; i++) {   
            if(images[i].getAttribute("src").match("_n."))   
            {   
                images[i].onmouseover = function() {   
                    this.setAttribute("src", this.getAttribute("src").replace("_n.", "_o."));   
                }   
                images[i].onmouseout = function() {   
                    this.setAttribute("src", this.getAttribute("src").replace("_o.", "_n.")); 
                }   
            }
            //2010/12/15追加分
            setMapChange(images[i]);
        }   
    }   
}   
if(window.addEventListener) {   
    window.addEventListener("load", smartRollover, false);   
}   
else if(window.attachEvent) {   
    window.attachEvent("onload", smartRollover);   
}




