<!-- 
function email(domain,recipient,title,subject){ 
  document.write('<a href=\"mailto:' + recipient + '@' + domain + subject + '\">'); 
  document.write(title + "<" + "/a>"); 
}


function AJAX() {
  this.server = Array();
}
AJAX.prototype.request = function(url, post, callback) {
  var serverIndex = -1;
  for (var x = 0; x < this.server.length; x++) {
    if (this.server[x].readyState == 4) {
	  serverIndex = x;
	}
  }
  if (serverIndex < 0) {
    serverIndex = this.server.length;
	this.server[serverIndex] = (document.all ? new ActiveXObject("Microsoft.XMLHTTP") : new XMLHttpRequest());
  }

  var req = new AJAXRequest(this.server[serverIndex], url, post, callback);
  var method = ((post != undefined && post != null) ? "POST" : "GET");

  req.server.open(method, url, true);
  req.server.onreadystatechange = function() {
    req.stateChange()
  };
  
  req.server.send(post);
}

function AJAXRequest(server, url, post, callback) {
  this.url = url;
  this.post = post;
  this.callback = callback;
  this.server = server;
  this.data;
  this.xml;
}
AJAXRequest.prototype.stateChange = function() {
  if(this.server.readyState == 4){
    this.data = this.server.responseText;
	this.xml = this.server.responseXML;
	if (this.callback != undefined) {
	  this.callback(this.data, this.xml);
	}
  }
}

function AJAXPost() {
  this.params = Array();
}
AJAXPost.prototype.param = function(name, value) {
  if (value != undefined) {
    this.params[name] = value;
  }
  return this.params[name];
}

AJAXPost.prototype.toString = function() {
  var str = "";
  for (i in this.params) {
    if (str != "") {
	  str+="&";
	}
    str+=escape(i) + "=" + escape(this.params[i]);
  }
  return str;
}

function validate(f) {
  var serv = new AJAX();
  var sButton = document.getElementById('sub_button1');
  var sText = sButton.value;
  sButton.disabled = true;
  sButton.value = "Validating...";
  serv.request("form/process.php?method=validate&code=" + document.getElementById('sec_code').value, null, function(d) {
    if (d == 1) {
	  f.submit();
	}
	else {
	  alert('You did not enter the security code correctly. If you are sure the security code has been entered correctly, please refresh your browser until the text on the image changes, and try again or email us directly at inquire@lagunaendodontics.com.');
	}
	sButton.disabled = false;
	sButton.value = sText;
  });
  return false;
}

-->
