function ShowOrHideEx(id, show) { var item = null; if (document.getElementById) { item = document.getElementById(id); } else if (document.all) { item = document.all[id]; } else if (document.layers){ item = document.layers[id]; } if (item && item.style) { item.style.display = show ? \"\" : \"none\"; } } var total_allow_rows = {$config['max_file_count']}; function AddImages() { var tbl = document.getElementById('tblSample'); var lastRow = tbl.rows.length; if (total_allow_rows && lastRow == total_allow_rows ) return; // if there's no header row in the table, then iteration = lastRow + 1 var iteration = lastRow+1; var row = tbl.insertRow(lastRow); var cellRight = row.insertCell(0); var el = document.createElement('input'); el.setAttribute('type', 'file'); el.setAttribute('name', 'addimg_' + iteration); el.setAttribute('size', '41'); el.setAttribute('value', iteration); cellRight.appendChild(el); document.getElementById('images_number').value = iteration; } function RemoveImages() { var tbl = document.getElementById('tblSample'); var lastRow = tbl.rows.length; if (lastRow > 1){ tbl.deleteRow(lastRow - 1); document.getElementById('images_number').value = document.getElementById('images_number').value - 1; } } "; $addim .= <<
   
HTML; $tpl->set( '{addimg}', $addim ); #### IMG ?>