//
//  This javascript file defines all the javascript functions used only by the ContactDisplay.jsp page.
// 

ContactDisplayJS={  
  
  sendContactRequest:function (formId){
    var form = document.getElementById(formId);
    reWhiteSpace = new RegExp(/^\s+$/);
    
    // ECONDA START
    emos_userEvent1('scontact',form.subject);
    // ECONDA END
    
    if(form.title.value == ""){ Common.formErrorHandleClient("title",Common.errorMessages["ERROR_TitleEmpty"],form.name); return;}
    if(form.firstName != null && reWhiteSpace.test(form.firstName.value) || form.firstName.value == ""){ Common.formErrorHandleClient("firstName",Common.errorMessages["ERROR_FirstNameEmpty"],form.name); return;}
    if(form.lastName != null && reWhiteSpace.test(form.lastName.value) || form.lastName.value == ""){ Common.formErrorHandleClient("lastName",Common.errorMessages["ERROR_LastNameEmpty"],form.name); return;}
    if(form.emailAddress != null && reWhiteSpace.test(form.emailAddress.value) || form.emailAddress.value == ""){ Common.formErrorHandleClient("emailAddress",Common.errorMessages["ERROR_EmailEmpty"],form.name); return;}
    if(!Common.isValidEmail(form.emailAddress.value)){ Common.formErrorHandleClient("emailAddress",Common.errorMessages["ERROR_EmailInvalid"],form.name); return;}
    if(form.subject.value  == ""){ Common.formErrorHandleClient("subject",Common.errorMessages["ERROR_SubjectEmpty"],form.name); return;}
   
    form.submit();
    //wc.service.getServiceById("ContactRequestMessage").formId = formId;
    //wc.service.invoke( "ContactRequestMessage");   
  } 
}





