function hideDropdowns(){ var objElement = document.getElementById('dropdownDiv') if (objElement){ objElement.style.visibility = 'hidden'; } } function showDropdowns(){ var objElement = document.getElementById('dropdownDiv') if (objElement){ objElement.style.visibility = ''; } } function openWin(url,h,w) { var leftPos = null, topPos = null; if (top.screen) { if (screen.width) { leftPos = Math.round((screen.width-w-4)/2); topPos = Math.round((screen.height-h-10)/2); } else { leftPos = 50 topPos = 50 } } popupwin = window.open(url, "popup", "width=" + w + ",height=" + h + ",top=" + topPos + ",left=" + leftPos + ""); } function toggleSave(inID) { var nodeSave = document.getElementById(inID); if (nodeSave.style.display == 'none') { nodeSave.style.display = 'inline'; } else { nodeSave.style.display = 'none'; } } function SelectAll(inNode, partialName) { var tableNode = document.getElementById(partialName); var checkBoxCollection = tableNode.getElementsByTagName('input'); for (var i = 0; i < checkBoxCollection.length; i++) { if (checkBoxCollection[i].type =='checkbox') { checkBoxCollection[i].checked = inNode.checked; } } } function AddCustomListRow(newIndex) { if (!document.getElementById('txtProductNo_' + newIndex)) { if (document.getElementById('txtProductNo_' + (newIndex-1)).value != '' && document.getElementById('txtProductNo_' + (newIndex-1)).value != ' ') { var tableNode = document.getElementById('ctlTblCustomProductList'); var lastRow = tableNode.rows.length; var rowNode = tableNode.insertRow(lastRow); var tableCellNode = rowNode.insertCell(0); var textNode = document.createTextNode(' '); tableCellNode.className = 'tableCell'; tableCellNode.appendChild(textNode); tableCellNode = rowNode.insertCell(1); //input var inputNode try { //for IE *sigh. inputNode = document.createElement(''); } catch (ex) { //for Mozilla. inputNode = document.createElement('input'); inputNode.type = 'text'; inputNode.name = 'txtProductNo_' + newIndex; inputNode.id = 'txtProductNo_' + newIndex; inputNode.setAttribute('onBlur', 'AddCustomListRow(' + (newIndex + 1) + ')'); inputNode.maxlength = 5; } tableCellNode.className = 'tableCell3 tableCellRight'; tableCellNode.appendChild(inputNode); //spaces tableCellNode = rowNode.insertCell(2); tableCellNode.className = 'tableCell tableCellLeft'; tableCellNode.appendChild(textNode.cloneNode(true)); tableCellNode = rowNode.insertCell(3); tableCellNode.className = 'tableCell tableCellRight'; tableCellNode.appendChild(textNode.cloneNode(true)); tableCellNode = rowNode.insertCell(4); tableCellNode.className = 'tableCell tableCellLeft'; tableCellNode.appendChild(textNode.cloneNode(true)); tableCellNode = rowNode.insertCell(5); tableCellNode.className = 'tableCell tableCellLeft'; tableCellNode.appendChild(textNode.cloneNode(true)); tableCellNode = rowNode.insertCell(6); tableCellNode.className = 'tableCell tableCellLeft'; tableCellNode.appendChild(textNode.cloneNode(true)); document.getElementById('txtProductNo_' + newIndex).focus(); var hiddenNode = document.getElementById('hidNumberProducts'); hiddenNode.value = (hiddenNode.value - 0) + 1 } } }