﻿// topnav rollover
sfHover = function() {
	var sfEls = document.getElementById("TopNavigation").getElementsByTagName("LI");	
	for (var i=0; i<sfEls.length; i++) {
		sfEls[i].onmouseover=function() {		
			this.className +=" sfhover"; 
		}
		
		
		sfEls[i].onmouseout=function() {	
			this.className=this.className.replace(new RegExp(" sfhover\\b"), "");					
		}
	}
	
}
if (window.attachEvent) window.attachEvent("onload", sfHover);
		

// buttons from link rollover 		

function rolloverInit() {	
	for (var i=0; i<document.images.length; i++) {	
		//if (document.images[i].parentNode.parentNode.parentNode.parentNode.parentNode.className == "colRight") {    
        if (document.images[i].parentNode.parentNode.parentNode.className == "component") {	
			if (document.images[i].parentNode.parentNode.className == "txt") {
				setupRollover(document.images[i]);			
			}
		}
	}
}

function setupRollover(thisImage) {   
    if(thisImage.className != '' && thisImage.className != 'img') {   
	    thisImage.outImage = new Image();
	    thisImage.outImage.src = thisImage.src;
	    thisImage.onmouseout = rollOut;
	    thisImage.overImage = new Image();
	    thisImage.overImage.src = "../Resources/Images/btn_" + thisImage.className + "_on.gif";		    
	    thisImage.onmouseover = rollOver;     	
    } 
}

function rollOver() {
	this.src = this.overImage.src;
}

function rollOut() {
	this.src = this.outImage.src;
}

if (window.attachEvent) window.attachEvent("onload", rolloverInit);

// butttons from input rollover with type=submit
sfHoverBtn = function() {

	var sfBtnEls = document.getElementsByTagName("INPUT");		
	for (var i=0; i<sfBtnEls.length; i++) {
	    
	    var elt = sfBtnEls[i];
	    var type = elt.getAttribute('type');	    
	    
	    if (type != null && type.toLowerCase() == 'submit') {
	    
		    sfBtnEls[i].onmouseover=function() {
		    //alert(this.className);
				this.className == "sfhover"; 
		    }		
		
		    sfBtnEls[i].onmouseout=function() {	
				this.className == ""; 
			    //this.className=this.className.replace(new RegExp(" sfhover\\b"), "");					
		    }		    
		}
	}
	
}
if (window.attachEvent) window.attachEvent("onload", sfHoverBtn);


