var emailAlertXmlDocument = '';
var emailAlertValidationMessage = '';
function SaveEmailAlert()
{
    emailAlertValidationMessage = '';
    if (!ValidateEmailAlerts())
    {
        return;
    }
       
    emailAlertXmlDocument += '';
    //this function will build the xml for an email alert and pass it through to the web service
    //embedded function
    BuildEmailAlert();
    
//    alert(emailAlertXmlDocument);
//    
//    document.getElementById('txtArea').value = emailAlertXmlDocument;
//    return;
    //need to show and hide saving message, then hide the div that the placeholder is in
    
    var x = RemoteScriptingCall('/xNet/LoopLink/Services/LoopLinkEmailAlerts.asmx', '<PFRequestData>' + emailAlertXmlDocument + '</PFRequestData>','SaveEmailAlert','http://www.loopnet.com/LoopLink', 'PFResponseInfo');
    
//    alert(x);
    
    var section = document.getElementById('EmailAlertSection');
    
    if (section != null)
        section.style.display = 'none';
    
    var emailAlertConfirmation = document.getElementById('EmailAlertConfirmationDiv');
    if (emailAlertConfirmation != null)
        emailAlertConfirmation.style.display = '';
    
    
    return;
}
