
var rbes	= "spocblfsXspofejuYdpn";

function clarify(mfrm) {
  var temp = "";
	var s,c;
  for (i=0; i<=20; i++) {
    if (i == 8) {
  		temp += String.fromCharCode(64);
	  } else if (i == 16) {
		  temp += String.fromCharCode(46);
    } else {
        s = rbes.charCodeAt(i)-1;
  		  c = String.fromCharCode(s);
  		  temp += c;
    }
	} 	
	mfrm.recipient.value = temp;
}

  function showErrs(errMsg) {
	var winwidth  = 310;
	var winheight = 210;
    var errLeft = (window.screen.width/2) - (winwidth/2);
	var	errTop  = (window.screen.height/2)- (winheight/2);
    var errorWindow = window.open('','errorwin','width=' + winwidth + ',height=' + winheight + ',scrollbars');
	errorWindow.moveTo(errLeft,errTop);
    errorWindow.focus();
    with (errorWindow) {
	  document.write('<html><head><title></title>');
	  document.write('<link rel="stylesheet" href="bank/styles/kintak.css" type="text/css">');
	  document.write('</head><body>');
	  document.write(errMsg);
	  document.write('</p><p class="errbox">Please <a href="" onClick=javascript:window.close();>close this window</a> and make the necessary corrections</p>'); 
  	  document.write('</body></html>');
    }
  }
  
  function validateForm(frm) {
    var errors = '';
    with (frm) {
      if (realname.value == '') {
        errors += '<li>Your name is missing.</li>';
      }
      if (email.value == '') {
        errors += '<li>Your email address is missing.</li>';
      } else if ((email.value.indexOf('@') == -1) || (email.value.indexOf('.') == -1)) {
          errors += '<li>You have entered an invalid email address.</li>';
      }	  
      if (subject.value == '') {
        errors += '<li>A subject is required.</li>'; 
      }
      if (message.value == '') {
        errors += '<li>A message is required.</li>';
      }
    } // with
    if (errors != '') {
      errors = '<h4 class="msgbox">Sorry, there is a problem:</h4><p class="errbox">' + '<ul>' + errors + '</ul>';
      var isError = showErrs(errors);
    }
    document.returnValue = (errors == '');
  }
