var tbArtistId; var start = 0; var finish = 10; var totalCount = 0; var totalPages = 1; var hfArtistIdControlId; function getArtists(artistId, hfArtistId) { tbArtistId = artistId; hfArtistIdControlId = hfArtistId; var artistNames = document.getElementById(tbArtistId); start = 0; finish = 10; if (artistNames.value == "") { var dvResult = document.getElementById('dvResult'); dvResult.style.display = "none"; } else { var divElement = document.getElementById('dvResult'); divElement.style.display = "none"; element = document.getElementById(tbArtistId); var wheelElement = document.getElementById('wheelDiv'); coordinates = getAnchorPosition(tbArtistId); wheelElement.style.top=coordinates.y+element.offsetHeight+"px"; wheelElement.style.left=coordinates.x+"px"; wheelElement.style.position="absolute"; wheelElement.style.display = "block"; WebService.GetArtistNamesWithRowCount(artistNames.value, start, finish, onCompleteArtist, onErrorArtist, onTimeOutArtist); } } function nextStepArtist() { if (finish <= totalCount) { element = document.getElementById(tbArtistId); var wheelElement = document.getElementById('wheelDiv'); coordinates = getAnchorPosition(tbArtistId); wheelElement.style.top=coordinates.y+element.offsetHeight+"px"; wheelElement.style.left=coordinates.x+"px"; wheelElement.style.position="absolute"; wheelElement.style.display = "block"; var divElement = document.getElementById('dvResult'); divElement.style.display = "none"; start += 10; finish += 10; var artistNames = document.getElementById(tbArtistId); WebService.GetArtistNamesWithRowCount(artistNames.value, start, finish, onCompleteArtist, onErrorArtist, onTimeOutArtist); } } function previousStepArtist() { if (start >= 10) { element = document.getElementById(tbArtistId); var wheelElement = document.getElementById('wheelDiv'); coordinates = getAnchorPosition(tbArtistId); wheelElement.style.top=coordinates.y+element.offsetHeight+"px"; wheelElement.style.left=coordinates.x+"px"; wheelElement.style.position="absolute"; wheelElement.style.display = "block"; var divElement = document.getElementById('dvResult'); divElement.style.display = "none"; start -= 10; finish -= 10; var artistNames = document.getElementById(tbArtistId); WebService.GetArtistNamesWithRowCount(artistNames.value, start, finish, onCompleteArtist, onErrorArtist, onTimeOutArtist); } } function PreviousPageClick() { } function CalculateTotalPages() { x = parseInt(totalCount/10); pageCount = totalCount / 10; if (pageCount - x == 0) totalPages = x; else totalPages = x + 1; } function onCompleteArtist(arg) { var element = document.getElementById(tbArtistId); element.disabled = false; if (arg != null) { if (arg.length != 0) { var divElement = document.getElementById('dvResult'); divElement.innerHTML = ""; ulElement = document.createElement("ul"); totalCount = arg[arg.length-1]; CalculateTotalPages(); if (arg.length > 1) { var divList = document.createElement('div'); var ulElement = document.createElement("ul"); for(i=0;i 9) divNavigation.appendChild(previousLink); var textNode = document.createElement('span'); textNode.innerHTML = ' '+(finish/10) + ' of ' + totalPages + ' Pages'; textNode.style.styleFloat = "left"; textNode.setAttribute("style","float:left"); textNode.style.styleFloat = "left"; divNavigation.appendChild(textNode); var nextLink=document.createElement('a'); nextLink.setAttribute('href', 'javascript:nextStepArtist()'); var nextImage = document.createElement('img'); nextImage.setAttribute('name','imgPreviousPage'); var imageSrc = '../../../assets/images/template/arrow_right.gif'; if (baseHTTPPath != null) imageSrc = baseHTTPPath + '/assets/images/template/arrow_right.gif'; nextImage.setAttribute('src', imageSrc); nextLink.appendChild(nextImage); if (finish < totalCount) divNavigation.appendChild(nextLink); divElement.appendChild(divList); divElement.appendChild(newBr); divElement.appendChild(divNavigation); if (element.value == "") { divElement.style.display = "none"; } else { divElement.style.display = "block"; } coordinates = getAnchorPosition(tbArtistId); divElement.style.top=coordinates.y+element.offsetHeight+"px"; divElement.style.left=coordinates.x+"px"; divElement.style.position="absolute"; element.focus(); } } } var wheelElement = document.getElementById('wheelDiv'); wheelElement.style.display = "none"; } function onTimeOutArtist(arg) { } function onErrorArtist(arg) { } function setResultArtist(selectedValue, artistId) { document.getElementById(tbArtistId).value = selectedValue.replace("#", "'").trim(); document.getElementById(hfArtistIdControlId).value = artistId; document.getElementById('dvResult').style.display = "none"; document.getElementById(document.getElementById("hdnSelectedValueElementId").value).value = artistId; $('#' + tbArtistId).trigger('change'); } function onFocusArtistOutControl() { document.getElementById('dvResult').style.display = 'none'; }