- Skip to content
- ⌂ UMMC Home
- Education
- Academic Affairs
- For Prospective Students
- For Students
- For Residents and Fellows
- For Faculty
- School of Dentistry
- School of Graduate Studies
- School of Health Related Professions
- School of Medicine
- School of Nursing
- School of Population Health
- UMMC Online
- Faculty Directory
- Health Care
- Health Care Home
- All UMMC Services
- Children's of Mississippi
- Find a Doctor
- Find a Location
- Pay a Bill
- UMMC Pricing
- Patient and Visitor Information
- Referring Physicians
- Research
- Research Home
- Centers and Institutes
- Offices
- Resources
- Participate in Clinical Trials
- About
- A-Z Site Index
- About Us
- Accreditations
- History
- Jobs at UMMC
- Leadership
- Mission and Vision
- Give
- MyChart
- Appointments
"; if (results.sdrdetails != null) { drresults = results.sdrdetails; GetDrs(results.sdrdetails, searchTxt, ""); $(leftnavdr).attr("style", "display:block"); drInitialDisplay(); loadDoctorDropdowns(getFilteredDoctors(), searchTxt); } break; case "sronly": var leftnavdr = document.getElementById("leftnavdr"); $(leftnavdr).attr("style", "display:none") var mr = document.getElementById("mainRow"); $(mr).attr("class", "row widget text"); var sr = document.getElementById("sresults"); $(sr).attr("class", "medium-5 large-10 column"); var loc = document.getElementById("locations"); $(loc).attr("style", "display:none"); var vphdr = document.getElementById("dr_div"); $(vphdr).attr("style", "display:none"); GetSearchResults(results.sresult, searchTxt, page, show); GetNav(results.snav.sort(), refine, searchTxt); break; case "loca": var leftnavloc = document.getElementById("leftnavloc"); $(leftnavloc).attr("style", "display:none") var leftnavdr = document.getElementById("leftnavdr"); $(leftnavdr).attr("style", "display:none"); var leftnav = document.getElementById("leftnav"); $(leftnav).attr("style", "display:none"); var mr = document.getElementById("mainRow"); $(mr).attr("class", "row widget text"); var sr = document.getElementById("sresults"); $(sr).attr("style", "display:none"); var vphdr = document.getElementById("dr_div"); $(vphdr).attr("style", "display:none"); var loca = document.getElementById("locations"); $(loca).attr("class", "large-7 column"); out += "
"; out += "
Find a Location
" out += "
UMMC has hospitals in Jackson, Grenada, and Lexington, plus clinics throughout the state. Request an appointment online or call (888) 815-2005.
"; out += "
"; if (results.slocation != null) { locations = results.slocation; locationgroups = results.locationGroups; GetLocations(results.slocation, searchTxt, "", results.locationGroups); $(leftnavloc).attr("style", "display:block"); locInitialDisplay(); updateloc(); } break; default: GetSearchResults(results.sresult, searchTxt, page, show); GetNav(results.snav.sort(), refine, searchTxt); GetDrs(results.sdrdetails, searchTxt, ""); GetLocations(results.slocation, searchTxt, "", results.locationGroups); if (results.slocation.length == 0 && results.sdrdetails.length == 0) { var vphdr = document.getElementById("dr_div"); $(vphdr).attr("style", "display:none"); var loca = document.getElementById("locations"); $(loca).attr("style", "display:none"); var sr = document.getElementById("sresults"); $(sr).attr("class", "medium-4 large-10 column"); } else if (results.slocation.length != 0 && results.sdrdetails.length == 0) { var vphdr = document.getElementById("dr_div"); $(vphdr).attr("style", "display:none"); var sr = document.getElementById("sresults"); $(sr).attr("class", "medium-4 large-7 column"); } else if (results.slocation.length == 0 && results.sdrdetails.length != 0) { var loca = document.getElementById("locations"); $(loca).attr("style", "display:none"); var sr = document.getElementById("sresults"); $(sr).attr("class", "medium-4 large-7 column"); } drInitialDisplay(); locInitialDisplay(); break; } } else { GetSearchResults(results.sresult, searchTxt, page, show); GetNav(results.snav, refine, searchTxt); GetDrs(results.sdrdetails, searchTxt, ""); GetLocations(results.slocation, searchTxt, "", results.locationGroups); } srch.innerHTML = out; } }, function () { $("#mainRow").css("opacity", "1.0"); }); } function dowork_phys(w) { var searchTxt = document.getElementById('UMCMainContent_txtsearch').value; var refine = document.getElementById('UMCMainContent_txtrefine').value; var show = document.getElementById('UMCMainContent_txtshow').value; var page = document.getElementById('UMCMainContent_txtpage').value; var type = "Main"; if (show == "phys") type = "Doctors"; if (show == "loca") type = "Locations"; if (page == null || page == "") page = 0; if (lastval == (searchTxt.trim() + "_" + refine.trim() + "_" + show.trim() + "_" + currentDisplayLetter + "_" + page)) { return; } cancelRequest(); $("#mainRow").css("opacity", "0.5"); lastrequest = ss.getAllSorted(w, searchTxt, refine, page, true, function (results) { $("#mainRow").css("opacity", "1.0"); lastval = searchTxt.trim() + "_" + refine.trim() + "_" + show.trim() + "_" + currentDisplayLetter + "_" + page; alldepartments = results.departments; if (results != null) { if (show != null) { var out = ""; var srch = document.getElementById("srchtxt"); switch (show) { case "phys": var leftnavdr = document.getElementById("leftnavdr"); var leftnav = document.getElementById("leftnav"); $(leftnav).attr("style", "display:none"); var mr = document.getElementById("mainRow"); $(mr).attr("class", "row widget text expanded"); var leftnav = document.getElementById("leftnav"); $(leftnav).attr("class", "medium-12 large-8 xlarge-9 column"); var sr = document.getElementById("sresults"); $(sr).attr("style", "display:none"); var loc = document.getElementById("locations"); $(loc).attr("style", "display:none"); var vphdr = document.getElementById("dr_div"); $('#leftnavdr').removeClass(); $('#leftnavdr').addClass("medium-12 large-4 xlarge-3 column"); $('#dr_div').removeClass(); $('#dr_div').addClass("medium-12 large-8 xlarge-9 column"); out += "
"; out += "
Find a Doctor
" out += "
You can search for a University physician or UMMC provider here. You may also narrow your search by gender or specialty. Request an appointment online or call (888) 815-2005.
"; out += "
"; if (results.sdrdetails != null) { drresults = results.sdrdetails; depts_refined = results.departments.slice(); GetDrs_phys(getFilteredDoctors(), searchTxt, "", ""); $(leftnavdr).attr("style", "display:block"); for (var x = 0; x < depts_refined.length; x++) { if (depts_refined[x].add == null) { depts_refined.splice(x, 1); x--; continue; } for (var y = 0; y < depts_refined[x].Value.length; y++) { if (depts_refined[x].Value[y].add == null) { depts_refined[x].Value.splice(y, 1); y--; } } } var spec = document.getElementById('UMCMainContent_txtspec').value; if (spec == "") { loadDoctorDropdowns(getFilteredDoctors(), searchTxt); } else { loadDoctorDropdowns(getFilteredDoctors(), searchTxt); } } else { } break; }//switch (show) { }//if (show != null) { else { GetSearchResults(results.sresult, searchTxt, page, show); GetNav(results.snav, refine, searchTxt); GetDrs(results.sdrdetails, searchTxt, ""); //GetLocations(results.slocation, searchTxt, ""); }//else: if (show != null) { srch.innerHTML = out; }//if (results != null) { }, function () { $("#mainRow").css("opacity", "1.0"); }); } function loadmoreOnClick(e) { e.preventDefault(); var vphdr = document.getElementById("dr_div"); if ($(vphdr).find("div#lower:hidden").length <= 10) { $("#loadMore").fadeOut('slow'); } $(vphdr).find("div#lower:hidden").slice(0, 10).slideDown(); } function loadmoreOnClickloc(e) { e.preventDefault(); var loca = document.getElementById("locations"); if ($(loca).find("div#lowerloc:hidden").length <= 10) { $("#loadMoreloc").attr("style", "display:none"); } $(loca).find("div#lowerloc:hidden").slice(0, 10).slideDown(); } function drInitialDisplay() { var vphdr = document.getElementById("dr_div"); $(vphdr).find("div#lower").attr("style", "display:none"); // $('html, body').animate({ scrollTop: '0px' }, 500); if ($(vphdr).find("div#lower:hidden").length <= 10) { $("#loadMore").attr("style", "display:none"); } else { $("#loadMore").attr("style", "display:block"); } $(vphdr).find("div#lower:hidden").slice(0, 10).show(); } function locInitialDisplay() { var loca = document.getElementById("locations"); $(loca).find("div#lowerloc").attr("style", "display:none"); // $('html, body').animate({ scrollTop: '0px' }, 500); if ($(loca).find("div#lowerloc:hidden").length <= 10) { $("#loadMoreloc").attr("style", "display:none"); } else { $("#loadMoreloc").attr("style", "display:block"); } $(loca).find("div#lowerloc:hidden").slice(0, 10).show(); } function removeURLParameter(url, parameter) { //prefer to use l.search if you have a location/link object var urlparts = url.split('?'); if (urlparts.length >= 2) { var prefix = encodeURIComponent(parameter) + '='; var pars = urlparts[1].split(/[&;]/g); //reverse iteration as may be destructive for (var i = pars.length; i-- > 0;) { //idiom for string.startsWith if (pars[i].lastIndexOf(prefix, 0) !== -1) { pars.splice(i, 1); } } url = urlparts[0] + '?' + pars.join('&'); return url; } else { return url; } } function updateloc() { var outdr = ""; var ddLocationGroups = document.getElementById("ddLocationGroups"); var ddAdultOrChildren = document.getElementById("ddAdultOrChildren"); var searchTxt = document.getElementById('UMCMainContent_txtsearch').value; var isChild = document.getElementById('UMCMainContent_txtischild').value; var txtLocGroup = document.getElementById('UMCMainContent_txtlocgroup').value; var SelectedLocationGroups = ddLocationGroups.options[ddLocationGroups.selectedIndex].value; if (txtLocGroup != "") { SelectedLocationGroups = txtLocGroup; $(ddLocationGroups).val(txtLocGroup); } var AdultOrChildren = ddAdultOrChildren.options[ddAdultOrChildren.selectedIndex].value; if (isChild == 1) { $(ddAdultOrChildren).val("1"); AdultOrChildren = 1; document.getElementById('UMCMainContent_txtischild').value = "0"; } document.getElementById('UMCMainContent_txtlocgroup').value = ""; var newURL = removeURLParameter(window.location.href, 'locgroup'); history.replaceState({}, '', newURL); var results = []; if (locations !== "undefined" || locations != null) { for (var key in locations) { var o = locations[key]; //if (isChild != "") { // if (isChild == 0 && o.Value.isChildren == 1) // continue; // if (isChild == 1 && o.Value.isChildren == 0) // continue; //} if (SelectedLocationGroups == "" && (AdultOrChildren == "" || AdultOrChildren == 2)) { results.push(locations[key]); } else if (SelectedLocationGroups != "" && AdultOrChildren == "") { if (o.Value.locationGroup == SelectedLocationGroups) results.push(locations[key]) } else if (SelectedLocationGroups != "" && AdultOrChildren != "") { if (AdultOrChildren == 0) { if (o.Value.locationGroup == SelectedLocationGroups && o.Value.isAdult == 1) results.push(locations[key]); } else if (AdultOrChildren == 1) { if (o.Value.locationGroup == SelectedLocationGroups && o.Value.isChildren == 1) results.push(locations[key]); } else if (AdultOrChildren == 2) { if (o.Value.locationGroup == SelectedLocationGroups) results.push(locations[key]); } } else if (SelectedLocationGroups == "" && AdultOrChildren != "") { if (AdultOrChildren == 0) { if (o.Value.isAdult == 1) results.push(locations[key]); } else if (AdultOrChildren == 1) { if (o.Value.isChildren == 1) results.push(locations[key]); } else if (AdultOrChildren == 2) { if (o.Value.isChildren == 2) results.push(locations[key]); } } } GetLocations(results, searchTxt, SelectedLocationGroups, locationgroups); locInitialDisplay(); } } function GetLocdd(locations, locationgroups, loc) { var outdr = ""; var dd = document.getElementById("ddLocationGroups"); var CurrentGroups = []; for (var key in locations) { var exists = false; var o = locations[key]; for (var i = 0; i < CurrentGroups.length; i++) { if (CurrentGroups[i].locationGroupID == o.Value.locationGroup) { exists = true; break; } } if (!exists) { for (var key in locationgroups) { if (locationgroups[key].locationGroupID == o.Value.locationGroup) { CurrentGroups.push(locationgroups[key]); break; } } } } if (CurrentGroups.length > 0) CurrentGroups.sort(); if (locations != null) { outdr += "
"; for (var i = 0; i < CurrentGroups.length; i++) { if (loc == CurrentGroups[i].locationGroupID) outdr += "
"; else outdr += "
"; } } dd.innerHTML = outdr; } function GetDrs(sdrdetails, searchTxt, sp) { var outdr = ""; var vphdr = document.getElementById("dr_div"); var vphresults = document.getElementById("sresults"); var deparments = []; var specialties = []; var spec = document.getElementById('UMCMainContent_txtspec').value; var isChild = document.getElementById('UMCMainContent_txtischild').value; if (sdrdetails != null) { var show = document.getElementById('UMCMainContent_txtshow').value; if (show != "phys") $(vphdr).attr("style", "display:block;max-width:350px;"); else $(vphdr).attr("style", "display:block;"); $(vphresults).attr("class", "medium-4 large-5 column"); outdr += "
"; outdr += "
"; outdr += "
"; if (show == "phys") { if (searchTxt != "" && sp != "") outdr += "Doctors - " + searchTxt + " - " + GetSpecialtyName(sp) + "
" + sdrdetails.length + " results
"; else if (searchTxt == "" && sp != "") outdr += "Doctors - " + GetSpecialtyName(sp) + "" + sdrdetails.length + " results
"; else if (searchTxt != "" && sp == "") outdr += "Doctors - " + searchTxt + "" + sdrdetails.length + " results
"; else if (spec != "") outdr += "Doctors - " + GetSpecialtyName(spec) + "" + sdrdetails.length + " results
"; else outdr += "Doctors" + sdrdetails.length + " results
"; } else { outdr += "Doctors"; } outdr += ""; outdr += "
"; for (var i = 0; i < sdrdetails.length; i++) { if (spec == "") { //if ((sdrdetails[i].dr_LFM).indexOf("-") > 0 || (sdrdetails[i].dr_LFM).indexOf("'") > 0 || (sdrdetails[i].dr_FullName.split(',')[0].indexOf(" ") > 0)) { //outdr += ""; //outdr += ""; //} else { //outdr += ""; //outdr += ""; //} outdr += '
'; outdr += ""; outdr += ""; outdr += " "; outdr += ""; outdr += ""; outdr += ""; if (show != "phys") outdr += ""; else outdr += ""; outdr += sdrdetails[i].dr_FullName; outdr += ""; if (show != "phys") outdr += ""; else outdr += ""; for (var d = 0; d < sdrdetails[i].dr_departments.length; d++) { for (var s = 0; s < sdrdetails[i].dr_departments[d].Specialties.length; s++) { outdr += sdrdetails[i].dr_departments[d].Specialties[s].title; } } //if (sdrdetails[i].dr_specDisplay != "") { // outdr += sdrdetails[i].dr_specDisplay.replace(/~/g, ','); //} else { // outdr += sdrdetails[i].dr_spec.replace(/~/g, ','); //} outdr += ""; outdr += ""; outdr += ""; outdr += ""; outdr += ""; var depts = sdrdetails[i].dr_departments; for (var j = 0; j < depts.length; j++) { if (depts[j].id.trim() != "") { if (sp.trim() != "") { if (depts[j].id.trim() == sp.trim()) { if (!containsObject(deparments, depts[j].id.trim(), false)) deparments.push(depts[j].id.trim()); } } else { if (!containsObject(deparments, depts[j].id.trim(), false)) deparments.push(depts[j].id.trim()); } } } for (var d = 0; d < sdrdetails[i].dr_departments.length; d++) { for (var s = 0; s < sdrdetails[i].dr_departments[d].Specialties.length; s++) { if (sdrdetails[i].dr_departments[d].Specialties[s].title.trim() != "") { if (!containsObject(specialties, sdrdetails[i].dr_departments[d].Specialties[s].title.trim(), false)) { specialties.push(sdrdetails[i].dr_departments[d].Specialties[s].title); } } } } //var speclist; //if (sdrdetails[i].dr_specDisplay != "") { // speclist = sdrdetails[i].dr_specDisplay.split("~"); //} else { // speclist = sdrdetails[i].dr_spec.split("~"); //} //for (var j = 0; j < speclist.length; j++) { // if (speclist[j].trim() != "") { // if (!containsObject(specialties, speclist[j].trim(), false)) // specialties.push(speclist[j].trim()); // } //} } else { var containsspec = false; for (var d = 0; d < sdrdetails[i].dr_departments.length; d++) { for (var s = 0; s < sdrdetails[i].dr_departments[d].Specialties.length; s++) { var specname = sdrdetails[i].dr_departments[d].Specialties[s].title.trim().toLowerCase(); if (specname.indexOf(spec.toLowerCase()) >= 0) { if (!containsObject(specialties, specname, false)) { specialties.push(specname); containsspec = true; } } } } //var speclist; //if (sdrdetails[i].dr_specDisplay != "") { // speclist = sdrdetails[i].dr_specDisplay.split("~"); //} else { // speclist = sdrdetails[i].dr_spec.split("~"); //} //for (var j = 0; j < speclist.length; j++) { // if (speclist[j].toLowerCase().trim().indexOf(spec.toLowerCase()) >= 0) { // if (!containsObject(specialties, speclist[j].trim(), false)) // specialties.push(speclist[j].trim()); // containsspec = true; // } //} if (containsspec) { if (isChild != "") { if (isChild == 1 && !sdrdetails[i].isChildren) continue; if (isChild == 0 && !sdrdetails[i].isAdult) continue; } //outdr += ""; //outdr += ""; outdr += '
'; outdr += ""; outdr += ""; outdr += " "; outdr += ""; outdr += ""; outdr += ""; outdr += ""; outdr += sdrdetails[i].dr_FullName; outdr += ""; outdr += ""; for (var d = 0; d < sdrdetails[i].dr_departments.length; d++) { for (var s = 0; s < sdrdetails[i].dr_departments[d].Specialties.length; s++) { outdr += sdrdetails[i].dr_departments[d].Specialties[s].title; } } outdr += ""; outdr += ""; outdr += ""; outdr += ""; outdr += ""; var depts = sdrdetails[i].dr_departments; for (var j = 0; j < depts.length; j++) { if (depts[j].id.trim() == "") continue; if (!containsObject(deparments, depts[j].id.trim(), false)) deparments.push(depts[j].id.trim()); } } } } var show = document.getElementById('UMCMainContent_txtshow').value; if (show != "phys") { outdr += "
"; outdr += "
"; outdr += "View More.."; outdr += "
"; outdr += "
"; outdr += "
"; } else { outdr += "
"; outdr += "
"; outdr += "View More.."; outdr += "
"; outdr += "
"; outdr += "
"; outdr += "
"; //outdr += "" + results.length + " results"; outdr += ""; outdr += "
"; //outdr += "Doctors"; if (searchTxt != "" && ds != "") outdr += "Doctors - " + searchTxt + " - " + GetSpecialtyName(ds) + "
9adbc084-627b-40e7-bd29-409575344263 results
"; else if (searchTxt == "" && ds != "") outdr += "Doctors - " + GetSpecialtyName(ds) + "9adbc084-627b-40e7-bd29-409575344263 results
"; else if (searchTxt != "" && ds == "") outdr += "Doctors - " + searchTxt + "9adbc084-627b-40e7-bd29-409575344263 results
"; else if (spec != "") outdr += "Doctors - " + GetSpecialtyName(spec) + "" + results.length + " results
"; else outdr += "Doctors9adbc084-627b-40e7-bd29-409575344263 results
"; outdr += ""; outdr += "
"; var rowTally = 0; if (results.length > showAllRecordsLimit) { showAllRecords = false; } if (showAllRecords == true) { //showAllRecords = false; //This should be tweaked to see how many records are displayed at once. If there are too many then this should be set to true. if (results.length > 0) { currentLetter = results[0].dr_FullName.toUpperCase().charAt(0); if (currentDisplayLetterBool == true) { currentDisplayLetter = currentLetter; currentDisplayLetterBool = false; } } for (var g = 0; g < results.length; g++) { if (!containsObject(alphagroup, results[g].dr_FullName.toLowerCase().charAt(0), false)) { alphagroup.push(results[g].dr_FullName.toLowerCase().charAt(0)); } } for (var i = 0; i < results.length; i++) { if ((currentLetter.toUpperCase() == results[i].dr_FullName.toUpperCase().charAt(0)) && (currentLetterFirst)) { outdr += "
"; incrementCounter = true; outdr += "
" + currentLetter.toUpperCase() + ""; outdr += "back to top"; outdr += "
"; currentLetterFirst = false; includedLetters.push(currentLetter.toUpperCase()); } if ((rowTally % rowItemCount == 0) || (i == 0)) { outdr += "
"; incrementCounter = true; } if (results[i] != undefined) { if (currentLetter.toUpperCase() != results[i].dr_FullName.toUpperCase().charAt(0)) { currentLetterFirst = true; nextalpha++; if (nextalpha < alphagroup.length) { currentLetter = alphagroup[nextalpha]; } outdr += "
"; rowTally = 0; i--; continue; } else { if (incrementCounter) { resultsCounter ++; } outdr += AddRecord(results[i], spec); } } if (rowTally % rowItemCount == (rowItemCount - 1)) { outdr += "
"; } else { outdr += "
"; } } if (currentLetter.toUpperCase() != results[i].dr_FullName.toUpperCase().charAt(0)) { currentLetterFirst = true; nextalpha++; if (nextalpha < alphagroup.length) { currentLetter = alphagroup[nextalpha]; } outdr += "
"; rowTally = 0; i--; continue; } else { if (results[i].dr_FullName.toUpperCase().charAt(0) == currentDisplayLetter) { outdr += AddRecord(results[i], spec); } } if (rowTally % rowItemCount == (rowItemCount - 1)) { outdr += "
- "; for (var g = 0; g < includedLetters.length; g++) { //alphagroup.push(results[g].FullName.toLowerCase().charAt(0)); //outdrABC += "
- " + includedLetters[g] + " "; //outdrABC += "
- " + includedLetters[g] + " "; if (showAllRecords == true) { outdrABC += "
- " + includedLetters[g] + " "; } else { outdrABC += "
- " + includedLetters[g] + " "; } } outdrABC += "
"; //if ((result.dr_LFM).indexOf("-") > 0 || (result.dr_LFM).indexOf("'") > 0 || (result.dr_FullName.split(',')[0].indexOf(" ") > 0)) { //returnString += ""; //} else { //returnString += ""; //} returnString += '
'; returnString += ""; returnString += ""; returnString += " "; returnString += ""; returnString += ""; returnString += ""; returnString += ""; returnString += result.dr_FullName; returnString += ""; returnString += ""; var specialtiesText = ""; for (var d = 0; d < result.dr_departments.length; d++) { for (var s = 0; s < result.dr_departments[d].Specialties.length; s++) { if (specialtiesText != "") { specialtiesText += ", "; } specialtiesText += result.dr_departments[d].Specialties[s].title.trim().toLowerCase(); } } if (specialtiesText != "") { returnString += specialtiesText; returnString += ""; } returnString += ""; returnString += ""; returnString += ""; returnString += ""; returnString += ""; returnString += "
"; //if ((result.dr_LFM).indexOf("-") > 0 || (result.dr_LFM).indexOf("'") > 0 || (result.dr_FullName.split(',')[0].indexOf(" ") > 0)) { //returnString += ""; //} else { //returnString += ""; //} outdr += '
'; returnString += ""; returnString += ""; returnString += " "; returnString += ""; returnString += ""; returnString += ""; returnString += ""; returnString += result.dr_FullName; returnString += ""; returnString += ""; var specialtiestext = ""; for (var d = 0; d < result.dr_departments.length; d++) { for (var s = 0; s < result.dr_departments[d].Specialties.length; s++) { if (specialtiestext != "") { specialtiestext += ", "; } specialtiestext += result.dr_departments[d].Specialties[s].title.trim().toLowerCase(); } } if (specialtiestext != "") { returnString += specialtiestext; returnString += ""; } returnString += ""; returnString += ""; returnString += ""; returnString += ""; returnString += ""; returnString += "
"; outloc += "
"; outloc += "
"; outloc += "Locations"; outloc += "
"; outloc += "
"; for (var key in results) { var o = results[key]; //I changed this to allow for locations to always be displayed if they are available. When there is a link to a website, there can be a circular reference //when someone is looking for the actualy location. //if (o.Value.locationLink == "") { // //outloc += ""; // outloc += ""; //} else { // //I added 'target="_blank"' to this because it resets the page when you go back to your search results. // outloc += ""; //} if (o.Value.locationID != "") { outloc += ""; } else { outloc += "
"; } outloc += ""; outloc += ""; outloc += " "; outloc += ""; outloc += ""; outloc += ""; if (show != "loca") outloc += ""; else outloc += ""; outloc += o.Value.locationName; outloc += ""; if (show != "loca") outloc += ""; else outloc += ""; outloc += "" + o.Value.locationAddress.replace("", ", "); outloc += ""; if (o.Value.locationContact != "") { if (show != "loca") outloc += ""; else outloc += ""; outloc += "" + o.Value.locationContact; outloc += ""; } if (o.Value.locationParking != "") { if (show != "loca") outloc += ""; else outloc += ""; outloc += "Parking: " + o.Value.locationParking; outloc += ""; } var isfirst = true; if (o.Value.servicelines.length > 0) { if (show != "loca") outloc += ""; else outloc += ""; outloc += "Specialties: "; for (var i = 0; i < o.Value.servicelines.length; i++) { if (isfirst) { isfirst = false; outloc += o.Value.servicelines[i]; } else { outloc += ", "; outloc += o.Value.servicelines[i]; } } outloc += ""; } //if (o.Value.locationLink != "") { // outloc += "" + o.Value.locationLink + ""; //} outloc += ""; outloc += ""; outloc += ""; outloc += ""; locs.push(results[key]); //for (var k in locs) { // if (locs[k].Value.locationGroup != o.Value.locationGroup) // locs.push(results[key]); //} } var show = document.getElementById('UMCMainContent_txtshow').value; if (show != "loca") { outloc += "
"; outloc += "
"; outloc += "View More.."; outloc += "
"; outloc += "
"; outloc += "
"; outloc += "
"; outloc += "View More.."; outloc += "
"; outloc += "
"; outsresult += "
"; outsresult += "
"; outsresult += "Search results for: " + searchTxt; outsresult += "
"; outsresult += "
"; var refine = document.getElementById('UMCMainContent_txtrefine').value; for (var i = 0; i < results.length; i++) { if (results[i].url.toLowerCase().indexOf("search.aspx?") >= 0) continue; if (refine.toLowerCase().indexOf("news") >= 0) { if (results[i].url.toLowerCase().indexOf("read-more-news.html") >= 0) continue; } outsresult += "
"; outsresult += "
"; outsresult += "
"; outsresult += "
"; outsresult += ""; if (results[i].title != "") outsresult += results[i].title; else outsresult += results[i].des.substring(0, 35) + "..."; outsresult += "
"; outsresult += "
" + results[i].url + "
"; outsresult += "
" + results[i].des + "
"; outsresult += "
"; outsresult += "
"; outsresult += "
"; } if (results.length == 10) { outsresult += "
"; outsresult += "
- "; outsresult += "
- page "; for (var i = 0; i < 10; i++) { var nextpage = i + 1; var url = "\search.aspx?q=" + searchTxt + "&page=" + i + "&refine=" + refine; if (page == i) outsresult += "
- You're on page" + nextpage + " "; else outsresult += "
- " + nextpage + " "; } outsresult += "
- page "; outsresult += "
"; outsresult += "
"; outsresult += "
"; outsresult += "
"; outsresult += "
"; outsresult += " No results found for: " + searchTxt; outsresult += "
"; outsresult += "
"; outsresult += "
"; outnav += "
"; outnav += "
"; outnav += " Filter options"; outnav += "
"; outnav += "
"; outnav += "
- "; if (refine != "") { $(refine.split(",")).each(function (index, value) { if (value != "") outnav += "
- " + value + " "; }); } for (var i = 0; i < results.length; i++) { var exist = false; $(refine.split(",")).each(function (index, value) { if (results[i] == value) exist = true; }); if (!exist) { outnav += "
- "; outnav += "" + results[i] + ""; outnav += " "; } } outnav += "
"; } else { outnav += "
"; outnav += "
"; outnav += " No Filter options"; outnav += "
"; outnav += "
"; outnav += "
Error returning profile information.
"; $('#loadingprofile').css('display', 'none'); } // error: function (jqXHR, textStatus, errorThrown) { // $('#lblError').text = 'Text Status: ' + textStatus + ' - Error Thrown: ' + errorThrown; // } }) break; case "loc": $.ajax({ type: 'GET', url: 'location.ashx?id=' + requestParam, contentType: 'text/plain; charset=utf-8', success: function (response) { var fullUrl = window.location.href.replace(/\/search\.aspx.*$/i, "") + "/location.aspx?id=" + requestParam; window.history.pushState({ path: fullUrl }, '', fullUrl); var fp = ""; var txtpro = ""; //var txtbio = ""; var splitString = "8c3e133a-83b4-461b-8545-f200a6eca82b"; if (response != null) { fp = response; } if (fp != "") { $('#profilecontainerdiv').html(fp); } else { //$('#ErrorMessage').text = ('Invalid CompanyID supplied'); } $('#loadingprofile').css('display', 'none'); }, error: function (response) { //alert(response.statusText); $('#loadingprofile').css('display', 'none'); } // error: function (jqXHR, textStatus, errorThrown) { // $('#lblError').text = 'Text Status: ' + textStatus + ' - Error Thrown: ' + errorThrown; // } }) break; } $('#loadingprofile').css('display', 'none'); } //------------------------------------------------------------------------------------- //The following code was adapted from Robin Osborne's blog. I made some modifications //to accomodate the large number of images I will load and to allow for the user to //freely scroll without loading all images that are before the scroll point. I also //added functionality to allow for loading images for a set distance in pixels above //and below the active view. //https://www.robinosborne.co.uk/2016/05/16/lazy-loading-images-dont-rely-on-javascript/ //------------------------------------------------------------------------------------- $(window).ready(function () { registerListener('scroll', callLazyLoadWithTimeout); }); var lazy = []; var scrollingTime; function setLazy() { //lazy = document.getElementsByClassName('lazy'); lazy = $('.displaytrue .lazy'); //lazyLoad(); } function callLazyLoadWithTimeout() { clearTimeout(scrollingTime); scrollingTime = setTimeout(function () { lazyLoad(); }, 1); } function lazyLoad() { outputTemp = []; var stringOutput = ""; for (var i = 0; i < lazy.length; i++) { if (isInViewport(lazy[i], true)) { if (lazy[i].getAttribute('data-src')) { lazy[i].src = lazy[i].getAttribute('data-src'); } lazy[i].removeAttribute('data-src'); } } cleanLazy(); //for (var i = 0; i < lazy.length; i++) { // if (isInViewport(lazy[i], true)) { // if (lazy[i].getAttribute('data-src')) { // lazy[i].src = lazy[i].getAttribute('data-src'); // } // lazy[i].removeAttribute('data-src'); // } //} //cleanLazy(); } function cleanLazy() { //var lazyTemp = []; //for (var i = 0; i < lazy.length; i++) { // if (lazy[i].getAttribute('data-src')) { // lazyTemp.push(lazy[i]); // } //} //lazy = lazyTemp; //The following code creates a new array that conforms to the function provided. The code does the same as above but is cleaner. lazy = Array.prototype.filter.call(lazy, function (a) { return a.getAttribute('data-src'); }); } function registerListener(event, func) { if (window.addEventListener) { window.addEventListener(event, func); } else { window.attachEvent('on' + event, func); } } function isInViewport(el, selectMore) { var rect = el.getBoundingClientRect(); if (selectMore) { return (//(rect.bottom >= (0 - 600) && (rect.bottom < window.innerHeight)) ||(rect.top >= -90 && (rect.bottom <= ((window.innerHeight + 90) || (document.documentElement.clientHeight + 90))))//(rect.right >= (0 - 600) && (rect.right < 0)) &&//(rect.top <= ((window.innerHeight + 600) || (document.documentElement.clientHeight + 600)) && rect.top > ((window.innerHeight) || (document.documentElement.clientHeight)))//(rect.left <= ((window.innerWidth + 600) || (document.documentElement.clientWidth + 600)) && rect.left > ( (window.innerWidth) || (document.documentElement.clientWidth)) )); } else { return (rect.bottom >= 0 && rect.right >= 0 && rect.top <= (window.innerHeight || document.documentElement.clientHeight) && rect.left <= (window.innerWidth || document.documentElement.clientWidth)); } } //------------------------------------------------------------------------------------- //https://www.robinosborne.co.uk/2016/05/16/lazy-loading-images-dont-rely-on-javascript/ //-------------------------------------------------------------------------------------
×