window.onload = function(){ //Wait for the page to load.
	
	var sForm = document.getElementById('catalogLogin');
    var inputs = document.getElementsByTagName('input'), input;
	
	if(document.getElementById("email_address").value!='') { document.getElementById("email_address").style.background = "url('/images/right_input.gif')"; }
	if(document.getElementById("password").value!='') { document.getElementById("password").style.background = "url('/images/right_input.gif')"; }
	
    for(var i=0,l=inputs.length;i<l;i++){ 
        input = inputs[i];
        if(input.name && input.name=='email_address'){ 
            input.onfocus = function(){ 
                if(document.getElementById("email_address").style.background = "url('/images/input_email.gif')") { document.getElementById("email_address").style.background = "url('/images/right_input.gif')";}
            }
			input.onblur = function(){
				if(document.getElementById("email_address").value=='') { document.getElementById("email_address").style.background = "url('/images/input_email.gif')";}
			}	
        }
		if(input.name && input.name=='password'){ 
            input.onfocus = function(){ 
                if(document.getElementById("password").style.background = "url('/images/input_pass.gif')") { document.getElementById("password").style.background = "url('/images/right_input.gif')";}
            }
			input.onblur = function(){
				if(document.getElementById("password").value=='') { document.getElementById("password").style.background = "url('/images/input_pass.gif')"}
			}	
        }
		if(input.name && input.name=='submit'){
				
			}	
    }
	
};