/*
	Standards Compliant Rollover Script
	Author : Daniel Nolan
	http://www.bleedingego.co.uk/webdev.php
*/

function initRollovers() {

	if (!document.getElementById) return
	
	var aPreLoad = new Array();
	var sTempSrc;
	var aImages = document.getElementsByTagName('img');
	var aInputs = document.getElementsByTagName('input');
	
	for (var i = 0; i < aInputs.length; i++){
	    if(!aInputs[i].src){
	    
	    }
	    else{
	        var src = aInputs[i].getAttribute('src')
	        if(src.substring(src.lastIndexOf('btR_goArrow_1'), src.length) == 'btR_goArrow_1.gif'){
	        	var ftype = src.substring(src.lastIndexOf('_1.'), src.length);
				var ftypeext = ftype.substring(ftype.lastIndexOf('.'),ftype.length);		
			    var hsrc = src.replace(ftype, '_2'+ftypeext);
			    
			    aInputs[i].setAttribute('hsrc', hsrc);
    			
			    aPreLoad[i] = new Image();
			    aPreLoad[i].src = hsrc;
    			
			    aInputs[i].onmouseover = function() {
				    sTempSrc = this.getAttribute('src');
				    this.setAttribute('src', this.getAttribute('hsrc'));
			    }	
    			
			    aInputs[i].onmouseout = function() {
				    if (!sTempSrc) sTempSrc = this.getAttribute('src').replace('_2'+ftype, ftype);
				    this.setAttribute('src', sTempSrc);
			    }
	        }
	    }

	    if(aInputs[i].className == 'imgover'){
	        if(aInputs[i].getAttribute('type') == 'image'){
			    var src = aInputs[i].getAttribute('src');
			    var ftype = src.substring(src.lastIndexOf('_1.'), src.length);
				var ftypeext = ftype.substring(ftype.lastIndexOf('.'),ftype.length);		
			    var hsrc = src.replace(ftype, '_2'+ftypeext);
			    
			    aInputs[i].setAttribute('hsrc', hsrc);
    			
			    aPreLoad[i] = new Image();
			    aPreLoad[i].src = hsrc;
    			
			    aInputs[i].onmouseover = function() {
				    sTempSrc = this.getAttribute('src');
				    this.setAttribute('src', this.getAttribute('hsrc'));
			    }	
    			
			    aInputs[i].onmouseout = function() {
				    if (!sTempSrc) sTempSrc = this.getAttribute('src').replace('_2'+ftype, ftype);
				    this.setAttribute('src', sTempSrc);
			    }
			    
	        }
	    }
	}

	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('_1.'), src.length);
			var ftypeext = ftype.substring(ftype.lastIndexOf('.'),ftype.length);
			var hsrc = src.replace(ftype, '_2'+ftypeext);

			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('_2'+ftype, ftype);
				this.setAttribute('src', sTempSrc);
			}
		}
	}
}