// Since we are removing and reshowing the form,
// IE does not do well with getting html elements
// so we must make the html valid before we push it
// back out to the public.
function ieInnerHTML(obj) {
 var zz = obj.innerHTML,
     z = 
   zz.match(/<\/?\w+((\s+\w+(\s*=\s*(?:".*?"|'.*?'|[^'">\s]+))?)+\s*|\s*)\/?>/g);
  if (z){
    for (var i=0;i<z.length;i++){
      var y, zSaved = z[i];
      z[i] = z[i].replace(/(<?\w+)|(<\/?\w+)\s/,
                          function(a){return a.toLowerCase();});
      y = z[i].match(/\=\w+[?\s+|?>]/g);
       if (y){
        for (var j=0;j<y.length;j++){
          z[i] = z[i].replace(y[j],y[j]
                     .replace(/\=(\w+)([?\s+|?>])/g,'="$1"$2'));
        }
       }
       zz = zz.replace(zSaved,z[i]);
     }
   }
  return zz;
 }

// Validate email address format
function checkEmail(email) {
	if (/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(email)){
		return true;
	}
		return false;
}