1. var IEMAC = (navigator.userAgent.indexOf('Mac') != -1 && navigator.userAgent.indexOf('MSIE') != -1);
2. var W3CDOM = (document.createElement && document.getElementsByTagName && !IEMAC);
3.
4. if (W3CDOM) {
5. var extraTD = document.createElement('td');
6. extraTD.className = 'empty';
7. document.write('');
8. var extraButton = document.createElement('button');
9. extraButton.className = 'extraButton';
10. extraButton.appendChild(document.createTextNode('Collect all orders'));
11. extraButton.onclick = moveAllToOrderTable;
12. }
13.
14. window.onload = function () {
15. if (!W3CDOM) return;
16. var field = document.getElementById('searchField');
17. if (!field) return;
18.
19. var marker = document.createElement('tr');
20. marker.className = 'marker';
21. var trashLink = document.createElement('a');
22. trashLink.href = '#';
23. trashLink.innerHTML = 'trash ';
24. trashLink.className = 'trash';
25. var orderLink = document.createElement('a');
26. orderLink.href = '#';
27. orderLink.innerHTML = 'order ';
28. orderLink.className = 'order';
29.
30. var currentPrice = 0;
31.
32. var containers = document.getElementById('startTable').getElementsByTagName('tr');
33. for (var i=0;i