/*
	Standards Compliant Rollover Script
	Author : Daniel Nolan
	http://www.bleedingego.co.uk/webdev.php
	onLoad="rollovers();"
*/

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, '_over'+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('_over'+ftype, ftype);
				this.setAttribute('src', sTempSrc);
			}
		}
	}
}

window.onload = initRollovers;

/*******************************************************
SOOPA-ROLLOVERS
(c) 2001, Aaron Boodman
Updated July 28, 2001
http://www.youngpup.net
*******************************************************/

function rollovers()
{
	var img, sh, sn, sd;
	for (var i = 0; (img = document.images[i]); i++)
	{
		if (img.getAttribute)
		{
			sn = img.getAttribute("src");
			sh = img.getAttribute("hsrc");
			sd = img.getAttribute("dsrc");

			if (sn != "" && sn != null)
			{
				img.n = new Image();
				img.n.src = img.src;
			
				if (sh != "" && sh != null)
				{
					img.h = new Image();
					img.h.src = sh;
					img.onmouseover = soopaSwapOn;
					img.onmouseout  = soopaSwapOff;
				}

				if (sd != "" && sd != null)
				{
					img.d = new Image();
					img.d.src = sd;
					img.onmousedown = soopaSwapDown;
				}
			}
		}
	}
}

function soopaSwapOn() { this.src = this.h.src; }

function soopaSwapOff() { this.src  = this.n.src; }

function soopaSwapDown()
{
	this.src  = this.d.src;
	this.temp = typeof(document.onmouseup) != 'undefined' && typeof(document.onmouseup) != 'unknown' ? document.onmouseup : "";
	soopaSwapUp.img = this;
	document.onmouseup = soopaSwapUp;
}

function soopaSwapUp()
{
	var ths = soopaSwapUp.img;
	ths.src = ths.n.src;
	if (ths.temp) document.onmouseup = ths.temp;
}
