/*******************************************************************
 * soopa-rollovers.js
 * 7/28/2001
 * www.youngpup.net
 *
 * easiest rollovers on earth, baby!
 * see www.youngpup.net for documentation.
 *
 * "disable" function added by Aaron levitz on 5/19/2009
 *******************************************************************/
Event.observe(window, 'load', function() {
	soopaSetup();
});

function soopaSetup() {
	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
				}
				img.doNothing = doNothing;
			}
		}
	}
}
function soopaSwapOn() {
	this.src = this.h.src;
}

function soopaSwapOff() {
	this.src  = this.n.src;
}

function doNothing(){ }

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;
}

function disable(id){
	var link = document.getElementById(id);
	if (link.getAttribute) {
		link.removeAttribute("href");
		link.removeAttribute("onmouseover");
		link.removeAttribute("onmouseout")
		var children = link.childNodes;
		
		for(var c=0; c < children.length; c++) {
			if (children[c].getAttribute("dsrc")){
				children[c].src = children[c].getAttribute("dsrc");
			} else if (children[c].getAttribute("hsrc")){
				children[c].src = children[c].getAttribute("hsrc");
			}
			children[c].onmouseover = children[c].onmouseout = children[c].donothing;
		}
	}
}
