﻿/*
	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,	112, 85, 95, 110, 115, 131, 111, 96, 107, 119, 98, 84, 61, 47, 37, 27, 60, 67, 52, 49, 30, 15, 7, 26, 21, 6, 40);
var posY = Array(0,	0, 7, 20, 32, 47, 58, 65, 71, 84, 94, 100, 108, 143, 132, 146, 159, 159, 174, 181, 205, 196, 209, 225, 248, 270, 304, 318);

function guideRollover(){
	var buttonLiHtml = '';
	buttonLiHtml += '<p id="bottunList">';
	for(i=1; i<=27; 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+');" onmouseout="closeNouSpot('+i+');" title="'+elemnts.firstChild.innerHTML+'">&nbsp;&nbsp;&nbsp;</a>';
		} else {
			buttonLiHtml += '<a id="buttonArea'+i+'" class="pointClass" onmouseover="showNouSpot('+i+');" onmouseout="closeNouSpot('+i+');" title="'+elemnts.childNodes[1].innerHTML+'">&nbsp;&nbsp;&nbsp;</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<=27; i++){
		if (posX[i]){
			var buttonStyle = document.getElementById('buttonArea'+i).style;
			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();
}