/*
DOM Image Rollover v3 (hover)
Demo: http://chrispoole.com/scripts/dom_image_rollover_hov
Script featured on: Dynamic Drive (http://www.dynamicdrive.com)
=====================================================================
copyright Chris Poole
http://chrispoole.com
This software is licensed under the MIT License 
<http://opensource.org/licenses/mit-license.php>
*/
class_name="roll";hover_state=true;down_state=false;function domRollover(d,g,h){if(navigator.userAgent.match(/Opera (\S+)/)){var c=parseInt(navigator.userAgent.match(/Opera (\S+)/)[1]);}if(!document.getElementById||c<7){return;}var a=document.getElementsByTagName("img");var f=new Array();var e=new Array();var b=/(_off|_hov|_down)\.(jpg|gif|png)/;for(i=0;i<a.length;i++){if(a[i].className.indexOf(h)!=-1){e[i]=a[i].getAttribute("src");if(d){f[i]=new Image();f[i].src=e[i].replace(b,"_hov.$2");a[i].onmouseover=function(){this.setAttribute("src",this.src.replace(b,"_hov.$2"));};}if(g){f[i]=new Image();f[i].src=e[i].replace(b,"_down.$2");a[i].onmousedown=function(){this.setAttribute("src",this.src.replace(b,"_down.$2"));};a[i].onmouseup=function(){this.setAttribute("src",this.src.replace(b,"_hov.$2"));};}a[i].onmouseout=function(){this.setAttribute("src",this.src.replace(b,"_off.$2"));};}}}window.onload=function(){domRollover(hover_state,down_state,class_name);};