function _submit(){
     var inputs = document.getElementsByTagName("input");
     for (var i=0; i<inputs.length; i++)  {
          if (inputs[i].className == "submit")  {
               inputs[i].onmouseover = function()
               {
                  this.src = this.src.replace(".png", "-hover.png");
               }
               inputs[i].onmouseout = function()
               {
                    this.src = this.src.replace("-hover.png", ".png");
                    this.src = this.src.replace("-active.png", ".png");
               }
			   inputs[i].onmousedown = function()
			   {
				this.src = this.src.replace("-hover.png", ".png");
	            this.src = this.src.replace(".png", "-active.png");
    	       }
         }
         if ((inputs[i].type == "text") && (inputs[i].parentNode.tagName == "SPAN"))
         {
         		inputs[i].onmouseover = function() {
         			if (this.parentNode.className.indexOf("hover") == -1)
         			{
         				this.parentNode.className += " hover";
         			}
         		};
         		inputs[i].onmouseout = function() {
       				this.parentNode.className = this.parentNode.className.replace("hover", "");
         		}
         		inputs[i].onfocus = function() {
         			if (this.parentNode.className.indexOf("focus") == -1)
         			{
         				this.parentNode.className += " focus";
         			}
         			this.parentNode.className = this.parentNode.className.replace("hover", "");
         		};
         		inputs[i].onblur = function() {
         			this.parentNode.className = this.parentNode.className.replace("hover", "");
         			this.parentNode.className = this.parentNode.className.replace("focus", "");
         		};
         }
     }
}
function preload(){
	var image1 = new Image();
    image1.src = "images/button-submit-hover.png";	
	var image2 = new Image();
    image2.src = "images/button-submit-active.png";	
	var image3 = new Image();
    image3.src = "images/button-result-submit-hover.png";	
	var image4 = new Image();
    image4.src = "images/button-result-submit-active.png";	
}
function _load(){
   _submit();
   preload();
}
if (window.addEventListener)
     window.addEventListener("load", _load, false);
else if (window.attachEvent)
     window.attachEvent("onload", _load)
