/*
	Header Information------------------------------------[Do Not Remove This Header]--
	Title: OO Dom Image Rollover
	Description: This script makes it easy to add rollover/ mousedown 
  	effects to any image on the page, including image submit buttons. Automatically 
  	preloads images as well. Script works in all DOM capable browsers- IE5+, NS6+, 
  	Opera7+.
	
	Legal: Copyright 2005 Adam Smith
	Author Email Address: ibulwark@hotmail.com
	Date Created: June 6, 2005
	Website: Codevendor.com | eBadgeman.com
	Script featured on Dynamic Drive: http://www.dynamicdrive.com
	-----------------------------------------------------------------------------------
*/

function imageholderclass(){function a(b,d,e){var c=this.src.length;this.src[c]=new Image;this.src[c].src=b;this.over[c]=new Image;this.over[c].src=e;this.down[c]=new Image;this.down[c].src=d}this.over=[];this.down=[];this.src=[];this.store=a}var ih=new imageholderclass,mouseisdown=0; function preloader(a){for(i=0;i<a.length;i++)if(a[i].getAttribute("srcover")||a[i].getAttribute("srcdown")){storeimages(a[i]);var b="";b=a[i].getAttribute("srcover")?b+"A":b+"";b=a[i].getAttribute("srcdown")?b+"B":b+"";switch(b){case "A":mouseover(a[i]);mouseout(a[i]);break;case "B":mousedown(a[i]);mouseup2(a[i]);break;case "AB":mouseover(a[i]);mouseout(a[i]);mousedown(a[i]);mouseup(a[i]);break;default:return}a[i].src&&a[i].setAttribute("oldsrc",a[i].src)}} function mouseup(a){var b;if(a.onmouseup){a.oldmouseup=a.onmouseup;b=function(){mouseisdown=0;this.src=this.getAttribute("srcover");this.oldmouseup()}}else b=function(){mouseisdown=0;this.src=this.getAttribute("srcover")};a.onmouseup=b}function mouseup2(a){var b;if(a.onmouseup){a.oldmouseup=a.onmouseup;b=function(){mouseisdown=0;this.src=this.getAttribute("oldsrc");this.oldmouseup()}}else b=function(){mouseisdown=0;this.src=this.getAttribute("oldsrc")};a.onmouseup=b} function mousedown(a){var b;if(a.onmousedown){a.oldmousedown=a.onmousedown;b=function(){if(mouseisdown==0){this.src=this.getAttribute("srcdown");this.oldmousedown()}}}else b=function(){if(mouseisdown==0)this.src=this.getAttribute("srcdown")};a.onmousedown=b}function mouseover(a){var b;if(a.onmouseover){a.oldmouseover=a.onmouseover;b=function(){this.src=this.getAttribute("srcover");this.oldmouseover()}}else b=function(){this.src=this.getAttribute("srcover")};a.onmouseover=b} function mouseout(a){var b;if(a.onmouseout){a.oldmouseout=a.onmouseout;b=function(){this.src=this.getAttribute("oldsrc");this.oldmouseout()}}else b=function(){this.src=this.getAttribute("oldsrc")};a.onmouseout=b}function storeimages(a){var b=a.getAttribute("src")?a.getAttribute("src"):"",d=a.getAttribute("srcdown")?a.getAttribute("srcdown"):"";a=a.getAttribute("srcover")?a.getAttribute("srcover"):"";ih.store(b,d,a)} function preloadimgsrc(){if(document.getElementById){var a=document.getElementsByTagName("IMG"),b=document.getElementsByTagName("INPUT");preloader(a);preloader(b)}}if(window.addEventListener)window.addEventListener("load",preloadimgsrc,false);else if(window.attachEvent)window.attachEvent("onload",preloadimgsrc);else if(document.getElementById)window.onload=preloadimgsrc;