﻿/*
	Standards Compliant Rollover Script
	Author : Daniel Nolan
	http://www.bleedingego.co.uk/webdev.php
*/

function initRollovers() {
	if (!document.getElementById) return
	
	var aPreLoad = new Array();
	var sTempSrc;
	var aImages = document.getElementsByTagName('img');

	for (var i = 0; i < aImages.length; i++) {		
		if (aImages[i].className == 'imgover') {
			var src = aImages[i].getAttribute('src');
			var ftype = src.substring(src.lastIndexOf('.'), src.length);
			var hsrc = src.replace(ftype, '_o'+ftype);

			aImages[i].setAttribute('hsrc', hsrc);
			
			aPreLoad[i] = new Image();
			aPreLoad[i].src = hsrc;
			
			aImages[i].onmouseover = function() {
				sTempSrc = this.getAttribute('src');
				this.setAttribute('src', this.getAttribute('hsrc'));
			}	
			
			aImages[i].onmouseout = function() {
				if (!sTempSrc) sTempSrc = this.getAttribute('src').replace('_o'+ftype, ftype);
				this.setAttribute('src', sTempSrc);
			}
		}
	}
}

var posX = Array(0, 65, 222, 76, 1, 352, 352, 260, 352, 352, 498, 88, 498, 502, 215);
var posY = Array(0, 180, 252, 236, 110, 0, 15, 191, 32, 48, 0, 255, 15, 32, 271);
var linkB = Array ("./", "../lineup/hookeye.html", "../lineup/wire.html", "../lineup/biastape.html", "../lineup/adjuster.html", "../lineup/knitted.html", "../lineup/tapey.html", "../lineup/motif.html", "../lineup/fixel.html", "../lineup/flont.html", "../lineup/maternity.html", "../lineup/film.html", "../lineup/crotch.html", "../lineup/coilbone.html", "../lineup/wirecasing.html");

var text = Array ("", "フックアイ詳細", "ワイヤー詳細", "バイアステープ詳細", "アジャスター詳細", "ニットループ詳細", "テーピースナッパー詳細", "モチーフ詳細", "フィクセルテープ詳細", "フロントホック詳細", "マタニティホック詳細", "フィルムボーン詳細", "クロッチテープ詳細", "コイルボーン詳細", "ワイヤーループ詳細");




function guideRollover(){
	var buttonLiHtml = '';
	buttonLiHtml += '<p id="bottunList">';
	for(i=1; i<=14; i++){
		elemnts = document.getElementById('pb'+i);
		document.getElementById('pb'+i).className = 'box';
		if (document.all){
			buttonLiHtml += '<a id="buttonArea'+i+'" class="pointClass" onmouseover="showNouSpot('+i+');" href="'+linkB[i]+'" onmouseout="closeNouSpot('+i+');" title="'+elemnts.firstChild.innerHTML+'">'+text[i]+'</a>';
		} else {
			buttonLiHtml += '<a id="buttonArea'+i+'" class="pointClass" onmouseover="showNouSpot('+i+');" href="'+linkB[i]+'" onmouseout="closeNouSpot('+i+');" title="'+elemnts.childNodes[1].innerHTML+'">'+text[i]+'</a>';
		}
		elemnts.style.display = 'none';
		elemnts.style.MozOpacity = '0.8';
		elemnts.style.opacity = '0.8';
		elemnts.style.filter = 'Alpha(opacity=80)';
	}
	buttonLiHtml += '</p>';	
	document.getElementById('buttonLi').innerHTML = buttonLiHtml;
	for(i=1; i<=14; i++){
		if (posX[i]){
			var buttonStyle = document.getElementById('buttonArea'+i).style;
			buttonStyle.position = 'absolute';
			buttonStyle.left = posX[i]+'px';
			buttonStyle.top = posY[i]+'px';
			buttonStyle.MozOpacity = '0.01';
			buttonStyle.opacity = '0.01';
			buttonStyle.filter = 'Alpha(opacity=1)';
		}
	}
}

function showNouSpot(elemNum){
	document.getElementById('pb'+elemNum).style.display = 'block';
}

function closeNouSpot(elemNum){
	document.getElementById('pb'+elemNum).style.display = 'none';
}

window.onload = function() {
	initRollovers();
	guideRollover();
}




