var showLoadingMain = '
Loading...
'; /***************************************** Show Modal after updating title/header *****************************************/ function showicorDialog(dType, dTitle, dBody, dColor) { var titlePrefix = ""; switch(dType) { case "success": titlePrefix = " "; break; case "error": titlePrefix = " "; break; case "contact": titlePrefix = " "; break; case "color": titlePrefix = " "; break; default: titlePrefix = " "; } //Set title and body $('#icorDialogTitle').html(titlePrefix + dTitle + ""); $('#icorDialogBody').html(dBody); //Show the html content $('#icorDialog').modal('show'); } /* Clear modal html when clicked */ $('#icorDialog').on('hidden.bs.modal', function () { $('#icorDialogBody').html(""); }) /********************************* Show contact form when clicked *********************************/ $(document).on('click', '.contactICOR', function(e){ e.preventDefault(); var contactHTML = ""; contactHTML += "

The International Consortium For Organizational Resilience

"; contactHTML += "

ICOR's Complaints and Appeals Policy

"; contactHTML += "

 P.O. Box 1171, "; contactHTML += "Lombard, Illinois 60148

"; contactHTML += "

 +1-630-705-0910

"; contactHTML += "

 Toll Free North America: 1-866-765-8321

"; contactHTML += "

 info@theICOR.org

"; contactHTML += "

Email Us!

"; contactHTML += "
"; contactHTML += ""; contactHTML += "
"; contactHTML += "
"; contactHTML += ""; contactHTML += "
"; contactHTML += "
"; contactHTML += ""; contactHTML += "
"; contactHTML += "
"; contactHTML += ""; contactHTML += "
"; contactHTML += "
"; contactHTML += "
"; showicorDialog('contact', 'Contact ICOR by mail, phone, or email', contactHTML);}); $(document).on("click", ".loadVenueInfo", function(e){ e.preventDefault(); var vid = $(this).attr('data-vid'); var city = $(this).attr('data-city'); var state = $(this).attr('data-state'); var citystate = $(this).attr('data-citystate'); $.post("scripts/loadVenue.php",{venue: vid}, function(data){ if (citystate != undefined) { showicorDialog("contact", "Viewing " + citystate + " Information", data); }else{ showicorDialog("contact", "Viewing " + city + ", " + state + " Information", data); } }); }); /*********************** Process Contact Form ***********************/ function processContact() { $("#processContactForm").prop("disabled",true); $("#processContactForm").html(" Sending Email..."); var cfname = $("#cf_name").val(); var cfemail = $("#cf_email").val(); var cfmessage = $("#cf_message").val(); var cfphone = $("#cf_phone").val(); var errorMessage = ""; if (cfname == "") { if (errorMessage != "") errorMessage += "
"; errorMessage += "You must enter a name."; } if (cfemail == "") { if (errorMessage != "") errorMessage += "
"; errorMessage += "You must enter an email."; } if (cfmessage == "") { if (errorMessage != "") errorMessage += "
"; errorMessage += "You must enter a message."; } if (errorMessage == "") { var varMessage = "Name: " + cfname + "\r\n"; varMessage += "Email: " + cfemail + "\r\n"; varMessage += "Phone: " + cfphone + "\r\n"; varMessage += "Message: " + cfmessage + "\r\n"; $.post("scripts/sendContactEmail.php",{cfname: cfname, cfemail: cfemail, cfmessage: cfmessage, cfphone: cfphone}, function(data){ //alert(data); var splitData = data.split("::"); if (splitData[0] == "SUCCESS") { showicorDialog("success", "Success", splitData[1]); }else{ $("#contact-error").html("" + splitData[1] + ""); } } ); }else{ $("#contact-error").html("" + errorMessage + ""); } $("#processContactForm").prop("disabled", false); $("#processContactForm").html("Send Email"); } /* Cookie/GDPR Accept Button */ $("#policy-button").on("click", function(e) { $("#policy-wrapper").remove(); $.post("scripts/policy-accept.php",{}, function(data){}); }); /* Show more when clicked */ $(".shd").click(function(){ var shid = $(this).attr('data-sid'); $("#hidden-"+shid).toggle(1000); }); var mainShowLoading = '
Loading...
'; var mainShowLoadingSmall = '
Loading...
'; function mainShowLoad(loadDiv) { $(loadDiv).html(mainShowLoading); } function main_post(url, pvars, loadDiv) { if (pvars === undefined) pvars = []; if (loadDiv === undefined) loadDiv = ""; return $.ajax({ url: url, type: 'post', data: pvars, dataType: 'html', beforeSend: mainShowLoad(loadDiv) }) .always(function() { $(loadDiv).html(""); }) .fail(function() { mainShowError("Loading " + url + " failed, please refresh the page and try again. If the issue persists, please contact us."); }); } function mainShowError(errorText) { var bodyText = ""; bodyText = '
'; bodyText += ''; bodyText += errorText; bodyText += '
'; $("#icorDialogTitle").html("Error Detected"); $("#icorDialogBody").html(bodyText); $("#icorDialog").modal() }