﻿function appendit() 
{ 
  var nodes = document.getElementsByTagName("INPUT"); 
  var Mycolor = "#FFFFCC";
  for (var i=0; i<nodes.length; i++) 
  { 
    var ctype = nodes[i].getAttribute("type"); 
    if (ctype == "text")
    {
      nodes[i].onfocus = function () { this.style.backgroundColor=Mycolor; this.style.color = "orange"; this.style.border="#6B78A9 1px solid";}
      nodes[i].onblur = function () { this.style.backgroundColor="#FFFFFF"; this.style.color = "#6B78A9"; this.style.border="#6B78A9 1px solid"}
    }
    if (ctype == "password")
    {
      nodes[i].onfocus = function () { this.style.backgroundColor=Mycolor; this.style.color = "orange"; this.style.border="#6B78A9 1px solid"; } 
      nodes[i].onblur = function () { this.style.backgroundColor="#FFFFFF"; this.style.color = "#6B78A9"; this.style.border="#6B78A9 1px solid"}
    }
  }
  nodes = document.getElementsByTagName("textarea");
  for (var i=0; i<nodes.length; i++)
  {
    nodes[i].onfocus = function () { this.style.backgroundColor=Mycolor; this.style.color = "orange"; this.style.border="#6B78A9 1px solid"; } 
    nodes[i].onblur = function () { this.style.backgroundColor="#FFFFFF"; this.style.color = "#6B78A9"; this.style.border="#6B78A9 1px solid"}
  }
}

function SubmitKeyClick(ElementById, Flag)
{
  if (event.keyCode == 13)
  {
    event.keyCode=9;event.returnValue = false;
    if(Flag == 0)
    {
      document.all[ElementById].focus();}else{document.all[ElementById].click();
    }
  }
}
