if(navigator.userAgent.indexOf("Mac")>-1) MAC=true; else MAC=false;

document.onmouseover = light
document.onmouseout = dark

pulseInterval = null
pulseElement = null

pulsePosition = 0
pulseColor = new Array(
	"#ffcc00",
	"#e5b200",
	"#cc9900",
	"#b27f00",
	"#996600",
	"#7f4c00",
	"#663300",
	"#4d1a00",
	"#330000",
	"#190019",
	"#000033",
	"#190019",
	"#330000",
	"#4d1a00",
	"#663300",
	"#7f4c00",
	"#996600",
	"#b27f00",
	"#cc9900",
	"#e5b200"
	)
pulseColorText = new Array(
	"#663300",
	"#4d1a00",
	"#330000",
	"#190019",
	"#000033",
	"#190019",
	"#330000",
	"#4d1a00",
	"#663300",
	"#7f4c00",
	"#996600",
	"#b27f00",
	"#cc9900",
	"#e5b200",
	"#ffcc00",
	"#e5b200",
	"#cc9900",
	"#b27f00",
	"#996600",
	"#7f4c00"
	)

function light(e) {
	if(event.srcElement.tagName=="A") {
		pulseElement = event.srcElement
		pulseElement.style.color = "#000000"
		pulseInterval = setInterval("pulse()",50)
	}
}
function dark(e) {
	if(event.srcElement.tagName=="A") {
		clearInterval(pulseInterval)
		if(MAC==true) {
			pulseElement.style.backgroundColor = "#000033"
		} else {
			pulseElement.style.removeAttribute("backgroundColor")
		}
		pulseElement.style.color = "#ffcc00"
		pulsePosition = 0
	}
}
function pulse() {
	pulseElement.style.backgroundColor = pulseColor[pulsePosition]
	pulseElement.style.color = pulseColorText[pulsePosition]
	pulsePosition++
	if(pulsePosition==pulseColor.length) pulsePosition = 0
}

