﻿function imageholderclass(){this.over=[];this.down=[];this.src=[];this.store=a;function a(d,b,c){var a=this.src.length;this.src[a]=new Image;this.src[a].src=d;this.over[a]=new Image;this.over[a].src=c;this.down[a]=new Image;this.down[a].src=b}}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}if(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 d=a.getAttribute("src")?a.getAttribute("src"):"",b=a.getAttribute("srcdown")?a.getAttribute("srcdown"):"",c=a.getAttribute("srcover")?a.getAttribute("srcover"):"";ih.store(d,b,c)}function preloadimgsrc(){if(!document.getElementById)return;var b=document.getElementsByTagName("IMG"),a=document.getElementsByTagName("INPUT");preloader(b);preloader(a)}if(window.addEventListener)window.addEventListener("load",preloadimgsrc,false);else if(window.attachEvent)window.attachEvent("onload",preloadimgsrc);else if(document.getElementById)window.onload=preloadimgsrc
