function jsGetEmbededMessage(uriBase, productid, projectTypeid, GenContentId, CustId, HraSeverity, section) { jQuery.support.cors = true; var uri = uriBase + '/EmbededMsg.svc/GetEmbededMessage/' + productid + '/' + projectTypeid + '/' + GenContentId + '/' + CustId + '/'+HraSeverity; ADAM$.jsonpCall(uri, function (xmldata) { var xml = xmldata.XmlDocumentString; $(xml).find('EmbededMessage').each(function () { var MSg = unescape($(this).find('Message').text()); var location = $(this).find('Location').text(); var SectionName = $(this).find('SectionName').text(); if (location == 1) { document.getElementById('divHeader').innerHTML = MSg; document.getElementById('divHeader').style.display = 'block'; } else if (location == 2) { document.getElementById('divFooter').innerHTML = MSg; document.getElementById('divFooter').style.display = 'block'; } else if (location == 3) { if (SectionName == section) { document.getElementById('top' + section).innerHTML = MSg; document.getElementById('top' + section).style.display = 'block'; } } else if (location == 4) { if (SectionName == section) { document.getElementById('bottom' + section).innerHTML = MSg; document.getElementById('bottom' + section).style.display = 'block'; } } }); }, function (error) { alert("error" + error); } ); } function jsGetServiceLineMapping(uriBase, productid, projectTypeid, GenContentId, CustId, CallFromTT) { if (CallFromTT == "1") { var slmTtdiv = document.getElementById("Div" + projectTypeid + "_" + GenContentId); if ($(slmTtdiv).has('a').length == 0) { GetSLM(uriBase, productid, projectTypeid, GenContentId, CustId, CallFromTT); } } else { GetSLM(uriBase, productid, projectTypeid, GenContentId, CustId, CallFromTT) } } function GetSLM(uriBase, productid, projectTypeid, GenContentId, CustId, CallFromTT) { jQuery.support.cors = true; var uri = uriBase + '/EmbededMsg.svc/GetServiceLineMappings/' + productid + '/' + projectTypeid + '/' + GenContentId + '/' + CustId + '/' + CallFromTT; ADAM$.jsonpCall(uri, function (data) { var xmlval = data.XmlDocumentString; $(xmlval).find('SLM').each(function () { var slm = $(this).attr('SLMName'); var slmUrl = $(this).attr('SLMURL'); var slmDisplayText = $(this).attr('SLMDisplayText'); var targetOpener = $(this).attr('TargetOpener'); var aTag = document.createElement('a'); aTag.id = "a" + slm; aTag.name = "a" + slm; aTag.className = "anchor"; var brk = document.createElement('br'); var brk1 = document.createElement('br'); aTag.setAttribute('href', slmUrl); aTag.innerHTML = slmDisplayText; if (CallFromTT == '0') { var slmdiv = document.getElementById("divSLM"); if (slmdiv.innerHTML == "\n  \n ") slmdiv.innerHTML = ""; if (slmdiv.innerHTML == " ") slmdiv.innerHTML = ""; slmdiv.appendChild(aTag); slmdiv.appendChild(brk); } else { var slmdiv = document.getElementById("Div" + projectTypeid + "_" + GenContentId); slmdiv.html = ""; slmdiv.appendChild(aTag); slmdiv.appendChild(brk); } }); if($('#divSLM').length > 0) if ($('#divSLM a').length < 1) { $("#divSLM").hide(); } else $("#divSLM").show(); }, function (error) { alert("error" + error); } ); }