﻿
function addCssReference(path) 
{
	var link = document.createElement('link');
	link.href = path;
	link.rel = "stylesheet";
	link.type = "text/css";
	document.getElementsByTagName('head')[0].appendChild(link);
}

function clickSubmitButton(code, id)
{
  if (code == 13) 
  { 
    button = document.getElementById(id);    
    if (typeof(button.click) != "undefined")
      button.click();
    else if (typeof(button.href) != "undefined") 
      eval(button.href.substr(11));
    else
      return true;
    
    return false;
  }
  return true;
}

// To create a visual notification that the value of an input element has changed

function checkChanged(e)
{
	var ctl = e.target;
	if (ctl == null)
		return;
	if (controlValues[ctl.id] == ctl.value)
		ctl.style.background = initialColor;
	else
		ctl.style.background = changedColor;
	return;
}

function setInitial(ctl)
{
	if (ctl == null)
		return;
	controlValues[ctl.id] = ctl.value;
}
