function addElement() {
var ni = document.getElementById('');
var divIdName = '';
var newdiv = document.createElement('div');
newdiv.setAttribute('id',divIdName);
newdiv.innerHTML = '';
ni.appendChild(newdiv);
}
function confirmSubmit() {
input_box=confirm("Are you sure you want to continue? Click OK to continue, or Cancel to stop");
if (input_box==true) {
document.getElementById('likeaction').value='doit';
document.getElementById('mainform').submit();
} else {
return false;
}
}
function toggleDown(nm) {
// written by Daniel P 3/21/07
// toggle checkboxes down a whole column
var lastskuindex = document.getElementById('lastindex');
for ( i=0; i<=lastskuindex.value; i++ ) {
if (document.getElementById(nm+i).checked) { // this one is currently checked
document.getElementById(nm+i).checked = false;
} else {
document.getElementById(nm+i).checked = true;
}
} // looping down the rows
}
function copyDown(nm) {
// written by Daniel P 3/20/07
// repeat the values of the first row of a column down the whole column
// special case for sku: value in incremented as you go down.
// also, values are only filled in for rows that have a sku filled in
var lastskuindex = document.getElementById('lastindex');
var firstitem = document.getElementById(nm+'0');
z = firstitem.value;
for ( i=1; i<=lastskuindex.value; i++ ) {
//window.receivelist["Received"+i].checked=true;
if (nm=='SKUCode' && z!='') { // special case for skucode (when not blank)
z++; // increments the sku
zstring = z.toString();
if ( zstring.length == 1 ) zstring='00000'+zstring;
if ( zstring.length == 2 ) zstring='0000'+zstring;
if ( zstring.length == 3 ) zstring='000'+zstring;
if ( zstring.length == 4 ) zstring='00'+zstring;
if ( zstring.length == 5 ) zstring='0'+zstring;
document.getElementById(nm+i).value = zstring;
} else {
if (document.getElementById('SKUCode'+i)) { // if there's an editable skucode (only add page)
if (document.getElementById('SKUCode'+i).value != '') { // only update this row if sku is filled in for this row
document.getElementById(nm+i).value = firstitem.value;
}
} else { // not add page, so we just update regardless of if sku is filled in
document.getElementById(nm+i).value = firstitem.value;
}
}
} // looping down the rows
}