function KeyTransform(evt)
{
  var r = '';

  if (document.all) {
    
//    r += event.ctrlKey ? 'C' : '';
//    r += event.altKey ? 'A' : '';
//    r += event.shiftKey ? 'S' : '';
    r += event.keyCode;
  }
  else if (document.getElementById)
  {
//    r += evt.ctrlKey ? 'C' : '';
//    r += evt.altKey ? 'A' : '';
//    r += evt.shiftKey ? 'S' : '';
    r += evt.charCode;
  }
  else if (document.layers)
  {
//    r += evt.modifiers & Event.CONTROL_MASK ? 'C' : '';
//    r += evt.modifiers & Event.ALT_MASK ? 'A' : '';
//    r += evt.modifiers & Event.SHIFT_MASK ? 'S' : '';
    r += evt.which;
  }

  return r;
}

function KeyPressIsSpace(evt)
{
	var e = KeyTransform(evt);
	
	return (e == 32);
}

function KeyPressIsNull(evt)
{
	var e = KeyTransform(evt);
	
	return (e == 0 || e == 'C0' || e == 'CA0' || e == 'CAS0' || e == 'CS0' || e == 'A0' || e == 'AS0' || e == 'S0');
}

function KeyPressIsDigit(evt)
{
	var e = KeyTransform(evt);

	return ((e >= 48 && e <= 57) || KeyPressIsNull(evt));
}

function KeyPressIsLetter(evt)
{
	var e = KeyTransform(evt);

	return ((e >= 65 && e <= 90) || (e >= 97 && e <= 122) || KeyPressIsNull(evt));
}

function KeyPressIsPhoneChar(evt)
{
	var e = KeyTransform(evt);

	return (e == 47 || e == 45 || e == 43 || e == 41 || e == 40 || KeyPressIsDigit(evt) || KeyPressIsSpace(evt) || KeyPressIsNull(evt));
}

function KeyPressIsEmailChar(evt)
{
	var e = KeyTransform(evt);

	return (e == 95 || e == 45 || e == 46 || e == 64 || KeyPressIsLetter(evt) || KeyPressIsDigit(evt) || KeyPressIsNull(evt))
}

function KeyPressIsUserNameChar(evt)
{
	return ( KeyPressIsLetter(evt) || KeyPressIsDigit(evt) || KeyPressIsNull(evt) )
}

function KeyPressReadOnly(evt)
{
	return KeyPressIsNull(evt);
}

function FormMensaje( texto, action, id )
{
	document.write('<form name=\"formMensaje_' + id + '\" id=\"formMensaje_' + id + '\" method=\"POST\" action=\"' + action + '\">');
	document.write('<input type=\"hidden\" name=\"fID\" value=\"' + id + '\">');
	document.write('</form>');
	document.write('<a href=\"javascript:formMensaje_' + id +'.submit()\">' + unescape(texto) + '</a>');
}
