validationRunning=false;
function makeValidationCall(_1){
if(validationRunning){
return;
}
validationRunning=true;
clearFieldErrors(_1);
formObj=document.forms[_1];
if(!formObj){
validationDone();
}
postParms=compileAllFieldValues(formObj);
if(!postParms){
validationDone();
}
postURL="/formsmgr/validate.php?"+postParms;
var _2=initHTTPObject();
_2.onreadystatechange=function(){
if(_2.readyState==4){
processValidationResponse(_1,_2.responseText);
}
};
_2.open("POST",postURL);
_2.send(null);
}
function processValidationResponse(_3,_4){
validationRunning=false;
found_errors=new Array();
_3=_3.toString();
if(!_4){
submitForm(_3);
}
eval(_4);
if(!found_errors){
submitForm(_3);
return;
}
for(i=0;i<=(found_errors.length-1);i++){
errornumber=i+1;
errormessage=found_errors[i][0];
fieldname=found_errors[i][1];
fieldid=found_errors[i][2];
showError(_3,errornumber,errormessage,fieldname,fieldid);
}
window.location="#"+_3+"top";
validationDone();
}
function showError(_5,_6,_7,_8,_9){
fieldErrorContainer=document.getElementById("fielderror-"+_9);
mainErrorsContainer=document.getElementById("formerrors"+_5);
fieldBlockContainer=document.getElementById("fieldblock-"+_9);
if(fieldErrorContainer){
fieldErrorContainer.innerHTML=_7;
}else{
if(mainErrorsContainer){
if(_8){
msg="<a href=\"javascript:document.forms['"+_5+"']['fields["+_8+"]'].focus()\">"+_7+"</a><br>";
}else{
msg=_7+"<br>";
}
divContents=mainErrorsContainer.innerHTML;
mainErrorsContainer.innerHTML=divContents+msg;
}else{
alert(_7);
}
}
if(fieldBlockContainer){
fieldBlockContainer.className="fieldblock-error";
}
}
function submitForm(_a){
formObj=document.forms[_a];
if(formObj){
formObj.submit();
}
validationDone();
}
function validationDone(){
validationRunning=false;
}
function clearFieldErrors(_b){
mainErrorsContainer=document.getElementById("formerrors"+_b);
if(mainErrorsContainer){
mainErrorsContainer.innerHTML="";
}
formElements=document.forms[_b].elements;
if(!formElements){
return;
}
for(i=0;i<formElements.length;i++){
if(!formElements[i].id){
continue;
}
groupid=formElements[i].getAttribute("fieldgroup");
if(groupid){
fieldErrorContainer=document.getElementById("fielderror-"+groupid);
fieldBlockContainer=document.getElementById("fieldblock-"+groupid);
}else{
fieldid=formElements[i].id;
fieldErrorContainer=document.getElementById("fielderror-"+fieldid);
fieldBlockContainer=document.getElementById("fieldblock-"+fieldid);
}
if(fieldErrorContainer){
fieldErrorContainer.innerHTML="";
}
if(fieldBlockContainer){
fieldBlockContainer.className="fieldblock";
}
}
}
function compileAllFieldValues(_c){
valuestring="";
for(var e=0;e<_c.elements.length;e++){
var el=_c.elements[e];
var _f="";
var _10="";
if(el.type=="radio"){
if(el.checked){
_f=el.name;
_10=el.value;
}
}else{
if(el.type=="checkbox"){
_f=el.name;
_10=el.checked;
}else{
_f=el.name;
_10=el.value;
}
}
valuestring+=escape(_f)+"="+escape(_10)+"&";
}
return valuestring;
}
function initHTTPObject(){
var _11;
try{
_11=new ActiveXObject("Msxml2.XMLHTTP");
}
catch(e){
try{
_11=new ActiveXObject("Microsoft.XMLHTTP");
}
catch(E){
_11=false;
}
}
if(!_11&&typeof XMLHttpRequest!="undefined"){
try{
_11=new XMLHttpRequest();
}
catch(e){
_11=false;
}
}
return _11;
}

