function jsGetSearchedItem(uriBase, prefixText, custId) {
jQuery.support.cors = true;
var uri = uriBase + 'TypeAheadSearch.svc/GetSearchedItem/' + prefixText + '/' + custId;
ADAM$.jsonpCall(uri,
function (data) {
var xml = data.XmlDocumentString;
var count = 0;
objectArray = new Array();
$('#autoSearchUL').empty();
var xmlDoc;
if (window.DOMParser) {
parser = new DOMParser();
xmlDoc = parser.parseFromString(xml, "text/xml");
}
else // Internet Explorer
{
xmlDoc = new ActiveXObject("Microsoft.XMLDOM");
xmlDoc.async = "false";
xmlDoc.loadXML(xml);
}
$(xmlDoc).find('TitleName').each(function () {
rowObj = new Object();
rowObj = $(this).children('Title').text();
var liStr = '
' + rowObj + '';
count += 1;
$('#autoSearchUL').append(liStr);
});
if (count == 0)
$('#autoSearchTitle').css('display', 'none');
else
$('#autoSearchTitle').css('display', 'block');
},
function (error) {
//alert("error" + error);
}
);
}
function jsGetSearchedItemByProductId(uriBase, prefixText, custId, ProductId) {
jQuery.support.cors = true;
var uri = uriBase + 'TypeAheadSearch.svc/GetSearchedItemProduct/' + prefixText + '/' + custId + '/' + ProductId;
ADAM$.jsonpCall(uri,
function (data) {
var xml = data.XmlDocumentString;
var count = 0;
objectArray = new Array();
$('#autoSearchUL').empty();
var xmlDoc;
if (window.DOMParser) {
parser = new DOMParser();
xmlDoc = parser.parseFromString(xml, "text/xml");
}
else // Internet Explorer
{
xmlDoc = new ActiveXObject("Microsoft.XMLDOM");
xmlDoc.async = "false";
xmlDoc.loadXML(xml);
}
$(xmlDoc).find('TitleName').each(function () {
rowObj = new Object();
rowObj = $(this).children('Title').text();
var liStr = '' + rowObj + '';
count += 1;
$('#autoSearchUL').append(liStr);
});
if (count == 0)
$('#autoSearchTitle').css('display', 'none');
else
$('#autoSearchTitle').css('display', 'block');
},
function (error) {
//alert("error" + error);
}
);
}
function jsGetSearchedItemForVIdeo(uriBase, prefixText, custId) {
//jQuery.support.cors = true;
var uri = uriBase + 'TypeAheadSearch.svc/GetSearchedItemForVideo/' + prefixText + '/' + custId;
// alert(uri);
ADAM$.jsonpCall(uri,
function (data) {
var xml = data.XmlDocumentString;
var count = 0;
objectArray = new Array();
$('#autoSearchUL').empty();
var xmlDoc;
if (window.DOMParser) {
parser = new DOMParser();
xmlDoc = parser.parseFromString(xml, "text/xml");
}
else // Internet Explorer
{
xmlDoc = new ActiveXObject("Microsoft.XMLDOM");
xmlDoc.async = "false";
xmlDoc.loadXML(xml);
}
$(xmlDoc).find('TitleName').each(function () {
rowObj = new Object();
rowObj = $(this).children('Title').text();
var liStr = '' + rowObj + '';
count += 1;
$('#autoSearchUL').append(liStr);
});
if (count == 0)
$('#autoSearchTitle').css('display', 'none');
else
$('#autoSearchTitle').css('display', 'block');
},
function (error) {
// alert( error);
}
);
}
function jsGetSearchedItemSpanish(uriBase, prefixText, custId) {
jQuery.support.cors = true;
var uri = uriBase + 'TypeAheadSearch.svc/GetSearchedItemSpanish/' + prefixText + '/' + custId;
ADAM$.jsonpCall(uri,
function (data) {
var xml = data.XmlDocumentString;
var count = 0;
objectArray = new Array();
$('#autoSearchUL').empty();
var xmlDoc;
if (window.DOMParser) {
parser = new DOMParser();
xmlDoc = parser.parseFromString(xml, "text/xml");
}
else // Internet Explorer
{
xmlDoc = new ActiveXObject("Microsoft.XMLDOM");
xmlDoc.async = "false";
xmlDoc.loadXML(xml);
}
$(xmlDoc).find('TitleName').each(function () {
rowObj = new Object();
rowObj = $(this).children('Title').text();
var liStr = '' + rowObj + '';
count += 1;
$('#autoSearchUL').append(liStr);
});
if (count == 0)
$('#autoSearchTitle').css('display', 'none');
else
$('#autoSearchTitle').css('display', 'block');
},
function (error) {
//alert("error" + error);
}
);
}