<!-- saved from url=(0014)about:internet --> <html> <head> <title>API Summary Page</title> <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=ISO-8859-1"> <style type="text/css"> th { font-size:1em; text-align:left; padding-top:5px; padding-bottom:4px; background-color:#969696; color:#fff; } td, th { font-size:0.75em; border:1px solid #969696; padding:3px 7px 2px 7px; } table { font-family:"Trebuchet MS", Arial, Helvetica, sans-serif; width:100%; border-collapse:collapse; } </style> <script type="text/javascript"> <!-- /* dragtable v1.0 June 26, 2008 Dan Vanderkam, http://danvk.org/dragtable/ http://code.google.com/p/dragtable/ Instructions: - Download this file - Add <script src="dragtable.js"></script> to your HTML. - Add class="draggable" to any table you might like to reorder. - Drag the headers around to reorder them. This is code was based on: - Stuart Langridge's SortTable (kryogenix.org/code/browser/sorttable) - Mike Hall's draggable class (http://www.brainjar.com/dhtml/drag/) - A discussion of permuting table columns on comp.lang.javascript Licensed under the MIT license. */ // Here's the notice from Mike Hall's draggable script: //***************************************************************************** // Do not remove this notice. // // Copyright 2001 by Mike Hall. // See http://www.brainjar.com for terms of use. //***************************************************************************** dragtable = { // How far should the mouse move before it's considered a drag, not a click? dragRadius2: 100, setMinDragDistance: function(x) { dragtable.dragRadius2 = x * x; }, // How long should cookies persist? (in days) cookieDays: 365, setCookieDays: function(x) { dragtable.cookieDays = x; }, // Determine browser and version. // TODO: eliminate browser sniffing except where it's really necessary. Browser: function() { var ua, s, i; this.isIE = false; this.isNS = false; this.version = null; ua = navigator.userAgent; s = "MSIE"; if ((i = ua.indexOf(s)) >= 0) { this.isIE = true; this.version = parseFloat(ua.substr(i + s.length)); return; } s = "Netscape6/"; if ((i = ua.indexOf(s)) >= 0) { this.isNS = true; this.version = parseFloat(ua.substr(i + s.length)); return; } // Treat any other "Gecko" browser as NS 6.1. s = "Gecko"; if ((i = ua.indexOf(s)) >= 0) { this.isNS = true; this.version = 6.1; return; } }, browser: null, // Detect all draggable tables and attach handlers to their headers. init: function() { // Don't initialize twice if (arguments.callee.done) return; arguments.callee.done = true; if (_dgtimer) clearInterval(_dgtimer); if (!document.createElement || !document.getElementsByTagName) return; dragtable.dragObj.zIndex = 0; dragtable.browser = new dragtable.Browser(); forEach(document.getElementsByTagName('table'), function(table) { if (table.className.search(/\bdraggable\b/) != -1) { dragtable.makeDraggable(table); } }); }, // The thead business is taken straight from sorttable. makeDraggable: function(table) { if (table.getElementsByTagName('thead').length == 0) { the = document.createElement('thead'); the.appendChild(table.rows[0]); table.insertBefore(the,table.firstChild); } // Safari doesn't support table.tHead, sigh if (table.tHead == null) { table.tHead = table.getElementsByTagName('thead')[0]; } var headers = table.tHead.rows[0].cells; for (var i = 0; i < headers.length; i++) { headers[i].onmousedown = dragtable.dragStart; } // Replay reorderings from cookies if there are any. if (dragtable.cookiesEnabled() && table.id && table.className.search(/\bforget-ordering\b/) == -1) { dragtable.replayDrags(table); } }, // Global object to hold drag information. dragObj: new Object(), // Climb up the DOM until there's a tag that matches. findUp: function(elt, tag) { do { if (elt.nodeName && elt.nodeName.search(tag) != -1) return elt; } while (elt = elt.parentNode); return null; }, // clone an element, copying its style and class. fullCopy: function(elt, deep) { var new_elt = elt.cloneNode(deep); new_elt.className = elt.className; forEach(elt.style, function(value, key, object) { if (value == null) return; if (typeof(value) == "string" && value.length == 0) return; new_elt.style[key] = elt.style[key]; }); return new_elt; }, eventPosition: function(event) { var x, y; if (dragtable.browser.isIE) { x = window.event.clientX + document.documentElement.scrollLeft + document.body.scrollLeft; y = window.event.clientY + document.documentElement.scrollTop + document.body.scrollTop; return {x: x, y: y}; } return {x: event.pageX, y: event.pageY}; }, // Determine the position of this element on the page. Many thanks to Magnus // Kristiansen for help making this work with "position: fixed" elements. absolutePosition: function(elt, stopAtRelative) { var ex = 0, ey = 0; do { var curStyle = dragtable.browser.isIE ? elt.currentStyle : window.getComputedStyle(elt, ''); var supportFixed = !(dragtable.browser.isIE && dragtable.browser.version < 7); if (stopAtRelative && curStyle.position == 'relative') { break; } else if (supportFixed && curStyle.position == 'fixed') { // Get the fixed el's offset ex += parseInt(curStyle.left, 10); ey += parseInt(curStyle.top, 10); // Compensate for scrolling ex += document.body.scrollLeft; ey += document.body.scrollTop; // End the loop break; } else { ex += elt.offsetLeft; ey += elt.offsetTop; } } while (elt = elt.offsetParent); return {x: ex, y: ey}; }, // MouseDown handler -- sets up the appropriate mousemove/mouseup handlers // and fills in the global dragtable.dragObj object. dragStart: function(event, id) { var el; var x, y; var dragObj = dragtable.dragObj; var browser = dragtable.browser; if (browser.isIE) dragObj.origNode = window.event.srcElement; else dragObj.origNode = event.target; var pos = dragtable.eventPosition(event); // Drag the entire table cell, not just the element that was clicked. dragObj.origNode = dragtable.findUp(dragObj.origNode, /T[DH]/); // Since a column header can't be dragged directly, duplicate its contents // in a div and drag that instead. // TODO: I can assume a tHead... var table = dragtable.findUp(dragObj.origNode, "TABLE"); dragObj.table = table; dragObj.startCol = dragtable.findColumn(table, pos.x); if (dragObj.startCol == -1) return; var new_elt = dragtable.fullCopy(table, false); new_elt.style.margin = '0'; // Copy the entire column var copySectionColumn = function(sec, col) { var new_sec = dragtable.fullCopy(sec, false); forEach(sec.rows, function(row) { var cell = row.cells[col]; var new_tr = dragtable.fullCopy(row, false); if (row.offsetHeight) new_tr.style.height = row.offsetHeight + "px"; var new_td = dragtable.fullCopy(cell, true); if (cell.offsetWidth) new_td.style.width = cell.offsetWidth + "px"; new_tr.appendChild(new_td); new_sec.appendChild(new_tr); }); return new_sec; }; // First the heading if (table.tHead) { new_elt.appendChild(copySectionColumn(table.tHead, dragObj.startCol)); } forEach(table.tBodies, function(tb) { new_elt.appendChild(copySectionColumn(tb, dragObj.startCol)); }); if (table.tFoot) { new_elt.appendChild(copySectionColumn(table.tFoot, dragObj.startCol)); } var obj_pos = dragtable.absolutePosition(dragObj.origNode, true); new_elt.style.position = "absolute"; new_elt.style.left = obj_pos.x + "px"; new_elt.style.top = obj_pos.y + "px"; new_elt.style.width = dragObj.origNode.offsetWidth + "px"; new_elt.style.height = dragObj.origNode.offsetHeight + "px"; new_elt.style.opacity = 0.7; // Hold off adding the element until this is clearly a drag. dragObj.addedNode = false; dragObj.tableContainer = dragObj.table.parentNode || document.body; dragObj.elNode = new_elt; // Save starting positions of cursor and element. dragObj.cursorStartX = pos.x; dragObj.cursorStartY = pos.y; dragObj.elStartLeft = parseInt(dragObj.elNode.style.left, 10); dragObj.elStartTop = parseInt(dragObj.elNode.style.top, 10); if (isNaN(dragObj.elStartLeft)) dragObj.elStartLeft = 0; if (isNaN(dragObj.elStartTop)) dragObj.elStartTop = 0; // Update element's z-index. dragObj.elNode.style.zIndex = ++dragObj.zIndex; // Capture mousemove and mouseup events on the page. if (browser.isIE) { document.attachEvent("onmousemove", dragtable.dragMove); document.attachEvent("onmouseup", dragtable.dragEnd); window.event.cancelBubble = true; window.event.returnValue = false; } else { document.addEventListener("mousemove", dragtable.dragMove, true); document.addEventListener("mouseup", dragtable.dragEnd, true); event.preventDefault(); } }, // Move the floating column header with the mouse // TODO: Reorder columns as the mouse moves for a more interactive feel. dragMove: function(event) { var x, y; var dragObj = dragtable.dragObj; // Get cursor position with respect to the page. var pos = dragtable.eventPosition(event); var dx = dragObj.cursorStartX - pos.x; var dy = dragObj.cursorStartY - pos.y; if (!dragObj.addedNode && dx * dx + dy * dy > dragtable.dragRadius2) { dragObj.tableContainer.insertBefore(dragObj.elNode, dragObj.table); dragObj.addedNode = true; } // Move drag element by the same amount the cursor has moved. var style = dragObj.elNode.style; style.left = (dragObj.elStartLeft + pos.x - dragObj.cursorStartX) + "px"; style.top = (dragObj.elStartTop + pos.y - dragObj.cursorStartY) + "px"; if (dragtable.browser.isIE) { window.event.cancelBubble = true; window.event.returnValue = false; } else { event.preventDefault(); } }, // Stop capturing mousemove and mouseup events. // Determine which (if any) column we're over and shuffle the table. dragEnd: function(event) { if (dragtable.browser.isIE) { document.detachEvent("onmousemove", dragtable.dragMove); document.detachEvent("onmouseup", dragtable.dragEnd); } else { document.removeEventListener("mousemove", dragtable.dragMove, true); document.removeEventListener("mouseup", dragtable.dragEnd, true); } // If the floating header wasn't added, the mouse didn't move far enough. var dragObj = dragtable.dragObj; if (!dragObj.addedNode) { return; } dragObj.tableContainer.removeChild(dragObj.elNode); // Determine whether the drag ended over the table, and over which column. var pos = dragtable.eventPosition(event); var table_pos = dragtable.absolutePosition(dragObj.table); if (pos.y < table_pos.y || pos.y > table_pos.y + dragObj.table.offsetHeight) { return; } var targetCol = dragtable.findColumn(dragObj.table, pos.x); if (targetCol != -1 && targetCol != dragObj.startCol) { dragtable.moveColumn(dragObj.table, dragObj.startCol, targetCol); if (dragObj.table.id && dragtable.cookiesEnabled() && dragObj.table.className.search(/\bforget-ordering\b/) == -1) { dragtable.rememberDrag(dragObj.table.id, dragObj.startCol, targetCol); } } }, // Which column does the x value fall inside of? x should include scrollLeft. findColumn: function(table, x) { var header = table.tHead.rows[0].cells; for (var i = 0; i < header.length; i++) { //var left = header[i].offsetLeft; var pos = dragtable.absolutePosition(header[i]); //if (left <= x && x <= left + header[i].offsetWidth) { if (pos.x <= x && x <= pos.x + header[i].offsetWidth) { return i; } } return -1; }, // Move a column of table from start index to finish index. // Based on the "Swapping table columns" discussion on comp.lang.javascript. // Assumes there are columns at sIdx and fIdx moveColumn: function(table, sIdx, fIdx) { var row, cA; var i=table.rows.length; while (i--){ row = table.rows[i] var x = row.removeChild(row.cells[sIdx]); if (fIdx < row.cells.length) { row.insertBefore(x, row.cells[fIdx]); } else { row.appendChild(x); } } // For whatever reason, sorttable tracks column indices this way. // Without a manual update, clicking one column will sort on another. var headrow = table.tHead.rows[0].cells; for (var i=0; i<headrow.length; i++) { headrow[i].sorttable_columnindex = i; } }, // Are cookies enabled? We should not attempt to set cookies on a local file. cookiesEnabled: function() { return (window.location.protocol != 'file:') && navigator.cookieEnabled; }, // Store a column swap in a cookie for posterity. rememberDrag: function(id, a, b) { var cookieName = "dragtable-" + id; var prev = dragtable.readCookie(cookieName); var new_val = ""; if (prev) new_val = prev + ","; new_val += a + "/" + b; dragtable.createCookie(cookieName, new_val, dragtable.cookieDays); }, // Replay all column swaps for a table. replayDrags: function(table) { if (!dragtable.cookiesEnabled()) return; var dragstr = dragtable.readCookie("dragtable-" + table.id); if (!dragstr) return; var drags = dragstr.split(','); for (var i = 0; i < drags.length; i++) { var pair = drags[i].split("/"); if (pair.length != 2) continue; var a = parseInt(pair[0]); var b = parseInt(pair[1]); if (isNaN(a) || isNaN(b)) continue; dragtable.moveColumn(table, a, b); } }, // Cookie functions based on http://www.quirksmode.org/js/cookies.html // Cookies won't work for local files. cookiesEnabled: function() { return (window.location.protocol != 'file:') && navigator.cookieEnabled; }, createCookie: function(name,value,days) { if (days) { var date = new Date(); date.setTime(date.getTime()+(days*24*60*60*1000)); var expires = "; expires="+date.toGMTString(); } else var expires = ""; var path = document.location.pathname; document.cookie = name+"="+value+expires+"; path="+path }, readCookie: function(name) { var nameEQ = name + "="; var ca = document.cookie.split(';'); for(var i=0;i < ca.length;i++) { var c = ca[i]; while (c.charAt(0)==' ') c = c.substring(1,c.length); if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length); } return null; }, eraseCookie: function(name) { dragtable.createCookie(name,"",-1); } } /* ****************************************************************** Supporting functions: bundled here to avoid depending on a library ****************************************************************** */ // Dean Edwards/Matthias Miller/John Resig // has a hook for dragtable.init already been added? (see below) var dgListenOnLoad = false; /* for Mozilla/Opera9 */ if (document.addEventListener) { dgListenOnLoad = true; document.addEventListener("DOMContentLoaded", dragtable.init, false); } /* for Internet Explorer */ /*@cc_on @*/ /*@if (@_win32) dgListenOnLoad = true; document.write("<script id=__dt_onload defer src=//0)><\/script>"); var script = document.getElementById("__dt_onload"); script.onreadystatechange = function() { if (this.readyState == "complete") { dragtable.init(); // call the onload handler } }; /*@end @*/ /* for Safari */ if (/WebKit/i.test(navigator.userAgent)) { // sniff dgListenOnLoad = true; var _dgtimer = setInterval(function() { if (/loaded|complete/.test(document.readyState)) { dragtable.init(); // call the onload handler } }, 10); } /* for other browsers */ /* Avoid this unless it's absolutely necessary (it breaks sorttable) */ if (!dgListenOnLoad) { window.onload = dragtable.init; } // Dean's forEach: http://dean.edwards.name/base/forEach.js /* forEach, version 1.0 Copyright 2006, Dean Edwards License: http://www.opensource.org/licenses/mit-license.php */ // array-like enumeration if (!Array.forEach) { // mozilla already supports this Array.forEach = function(array, block, context) { for (var i = 0; i < array.length; i++) { block.call(context, array[i], i, array); } }; } // generic enumeration Function.prototype.forEach = function(object, block, context) { for (var key in object) { if (typeof this.prototype[key] == "undefined") { block.call(context, object[key], key, object); } } }; // character enumeration String.forEach = function(string, block, context) { Array.forEach(string.split(""), function(chr, index) { block.call(context, chr, index, string); }); }; // globally resolve forEach enumeration var forEach = function(object, block, context) { if (object) { var resolve = Object; // default if (object instanceof Function) { // functions have a "length" property resolve = Function; } else if (object.forEach instanceof Function) { // the object implements a custom forEach method so use that object.forEach(block, context); return; } else if (typeof object == "string") { // the object is a string resolve = String; } else if (typeof object.length == "number") { // the object is array-like resolve = Array; } resolve.forEach(object, block, context); } }; //--> </script> <script type="text/javascript"> <!-- /* SortTable version 2 7th April 2007 Stuart Langridge, http://www.kryogenix.org/code/browser/sorttable/ Instructions: Download this file Add <script src="sorttable.js"></script> to your HTML Add class="sortable" to any table you'd like to make sortable Click on the headers to sort Thanks to many, many people for contributions and suggestions. Licenced as X11: http://www.kryogenix.org/code/browser/licence.html This basically means: do what you want with it. */ var stIsIE = /*@cc_on!@*/false; sorttable = { init: function() { // quit if this function has already been called if (arguments.callee.done) return; // flag this function so we don't do the same thing twice arguments.callee.done = true; // kill the timer if (_timer) clearInterval(_timer); if (!document.createElement || !document.getElementsByTagName) return; sorttable.DATE_RE = /^(\d\d?)[\/\.-](\d\d?)[\/\.-]((\d\d)?\d\d)$/; forEach(document.getElementsByTagName('table'), function(table) { if (table.className.search(/\bsortable\b/) != -1) { sorttable.makeSortable(table); } }); }, makeSortable: function(table) { if (table.getElementsByTagName('thead').length == 0) { // table doesn't have a tHead. Since it should have, create one and // put the first table row in it. the = document.createElement('thead'); the.appendChild(table.rows[0]); table.insertBefore(the,table.firstChild); } // Safari doesn't support table.tHead, sigh if (table.tHead == null) table.tHead = table.getElementsByTagName('thead')[0]; if (table.tHead.rows.length != 1) return; // can't cope with two header rows // Sorttable v1 put rows with a class of "sortbottom" at the bottom (as // "total" rows, for example). This is B&R, since what you're supposed // to do is put them in a tfoot. So, if there are sortbottom rows, // for backwards compatibility, move them to tfoot (creating it if needed). sortbottomrows = []; for (var i=0; i<table.rows.length; i++) { if (table.rows[i].className.search(/\bsortbottom\b/) != -1) { sortbottomrows[sortbottomrows.length] = table.rows[i]; } } if (sortbottomrows) { if (table.tFoot == null) { // table doesn't have a tfoot. Create one. tfo = document.createElement('tfoot'); table.appendChild(tfo); } for (var i=0; i<sortbottomrows.length; i++) { tfo.appendChild(sortbottomrows[i]); } delete sortbottomrows; } // work through each column and calculate its type headrow = table.tHead.rows[0].cells; for (var i=0; i<headrow.length; i++) { // manually override the type with a sorttable_type attribute if (!headrow[i].className.match(/\bsorttable_nosort\b/)) { // skip this col mtch = headrow[i].className.match(/\bsorttable_([a-z0-9]+)\b/); if (mtch) { override = mtch[1]; } if (mtch && typeof sorttable["sort_"+override] == 'function') { headrow[i].sorttable_sortfunction = sorttable["sort_"+override]; } else { headrow[i].sorttable_sortfunction = sorttable.guessType(table,i); } // make it clickable to sort headrow[i].sorttable_columnindex = i; headrow[i].sorttable_tbody = table.tBodies[0]; dean_addEvent(headrow[i],"click", function(e) { if (this.className.search(/\bsorttable_sorted\b/) != -1) { // if we're already sorted by this column, just // reverse the table, which is quicker sorttable.reverse(this.sorttable_tbody); this.className = this.className.replace('sorttable_sorted', 'sorttable_sorted_reverse'); this.removeChild(document.getElementById('sorttable_sortfwdind')); sortrevind = document.createElement('span'); sortrevind.id = "sorttable_sortrevind"; sortrevind.innerHTML = stIsIE ? ' <font face="webdings">5</font>' : ' ▴'; this.appendChild(sortrevind); return; } if (this.className.search(/\bsorttable_sorted_reverse\b/) != -1) { // if we're already sorted by this column in reverse, just // re-reverse the table, which is quicker sorttable.reverse(this.sorttable_tbody); this.className = this.className.replace('sorttable_sorted_reverse', 'sorttable_sorted'); this.removeChild(document.getElementById('sorttable_sortrevind')); sortfwdind = document.createElement('span'); sortfwdind.id = "sorttable_sortfwdind"; sortfwdind.innerHTML = stIsIE ? ' <font face="webdings">6</font>' : ' ▾'; this.appendChild(sortfwdind); return; } // remove sorttable_sorted classes theadrow = this.parentNode; forEach(theadrow.childNodes, function(cell) { if (cell.nodeType == 1) { // an element cell.className = cell.className.replace('sorttable_sorted_reverse',''); cell.className = cell.className.replace('sorttable_sorted',''); } }); sortfwdind = document.getElementById('sorttable_sortfwdind'); if (sortfwdind) { sortfwdind.parentNode.removeChild(sortfwdind); } sortrevind = document.getElementById('sorttable_sortrevind'); if (sortrevind) { sortrevind.parentNode.removeChild(sortrevind); } this.className += ' sorttable_sorted'; sortfwdind = document.createElement('span'); sortfwdind.id = "sorttable_sortfwdind"; sortfwdind.innerHTML = stIsIE ? ' <font face="webdings">6</font>' : ' ▾'; this.appendChild(sortfwdind); // build an array to sort. This is a Schwartzian transform thing, // i.e., we "decorate" each row with the actual sort key, // sort based on the sort keys, and then put the rows back in order // which is a lot faster because you only do getInnerText once per row row_array = []; col = this.sorttable_columnindex; rows = this.sorttable_tbody.rows; for (var j=0; j<rows.length; j++) { row_array[row_array.length] = [sorttable.getInnerText(rows[j].cells[col]), rows[j]]; } /* If you want a stable sort, uncomment the following line */ //sorttable.shaker_sort(row_array, this.sorttable_sortfunction); /* and comment out this one */ row_array.sort(this.sorttable_sortfunction); tb = this.sorttable_tbody; for (var j=0; j<row_array.length; j++) { tb.appendChild(row_array[j][1]); } delete row_array; }); } } }, guessType: function(table, column) { // guess the type of a column based on its first non-blank row sortfn = sorttable.sort_alpha; for (var i=0; i<table.tBodies[0].rows.length; i++) { text = sorttable.getInnerText(table.tBodies[0].rows[i].cells[column]); if (text != '') { if (text.match(/^-?[�$�]?[\d,.]+%?$/)) { return sorttable.sort_numeric; } // check for a date: dd/mm/yyyy or dd/mm/yy // can have / or . or - as separator // can be mm/dd as well possdate = text.match(sorttable.DATE_RE) if (possdate) { // looks like a date first = parseInt(possdate[1]); second = parseInt(possdate[2]); if (first > 12) { // definitely dd/mm return sorttable.sort_ddmm; } else if (second > 12) { return sorttable.sort_mmdd; } else { // looks like a date, but we can't tell which, so assume // that it's dd/mm (English imperialism!) and keep looking sortfn = sorttable.sort_ddmm; } } } } return sortfn; }, getInnerText: function(node) { // gets the text we want to use for sorting for a cell. // strips leading and trailing whitespace. // this is *not* a generic getInnerText function; it's special to sorttable. // for example, you can override the cell text with a customkey attribute. // it also gets .value for <input> fields. hasInputs = (typeof node.getElementsByTagName == 'function') && node.getElementsByTagName('input').length; if (node.getAttribute("sorttable_customkey") != null) { return node.getAttribute("sorttable_customkey"); } else if (typeof node.textContent != 'undefined' && !hasInputs) { return node.textContent.replace(/^\s+|\s+$/g, ''); } else if (typeof node.innerText != 'undefined' && !hasInputs) { return node.innerText.replace(/^\s+|\s+$/g, ''); } else if (typeof node.text != 'undefined' && !hasInputs) { return node.text.replace(/^\s+|\s+$/g, ''); } else { switch (node.nodeType) { case 3: if (node.nodeName.toLowerCase() == 'input') { return node.value.replace(/^\s+|\s+$/g, ''); } case 4: return node.nodeValue.replace(/^\s+|\s+$/g, ''); break; case 1: case 11: var innerText = ''; for (var i = 0; i < node.childNodes.length; i++) { innerText += sorttable.getInnerText(node.childNodes[i]); } return innerText.replace(/^\s+|\s+$/g, ''); break; default: return ''; } } }, reverse: function(tbody) { // reverse the rows in a tbody newrows = []; for (var i=0; i<tbody.rows.length; i++) { newrows[newrows.length] = tbody.rows[i]; } for (var i=newrows.length-1; i>=0; i--) { tbody.appendChild(newrows[i]); } delete newrows; }, /* sort functions each sort function takes two parameters, a and b you are comparing a[0] and b[0] */ sort_numeric: function(a,b) { aa = parseFloat(a[0].replace(/[^0-9.-]/g,'')); if (isNaN(aa)) aa = 0; bb = parseFloat(b[0].replace(/[^0-9.-]/g,'')); if (isNaN(bb)) bb = 0; return aa-bb; }, sort_revnumeric: function(a,b) { return -sorttable.sort_numeric(a,b) }, sort_alpha: function(a,b) { if (a[0]==b[0]) return 0; if (a[0]<b[0]) return -1; return 1; }, sort_ddmm: function(a,b) { mtch = a[0].match(sorttable.DATE_RE); y = mtch[3]; m = mtch[2]; d = mtch[1]; if (m.length == 1) m = '0'+m; if (d.length == 1) d = '0'+d; dt1 = y+m+d; mtch = b[0].match(sorttable.DATE_RE); y = mtch[3]; m = mtch[2]; d = mtch[1]; if (m.length == 1) m = '0'+m; if (d.length == 1) d = '0'+d; dt2 = y+m+d; if (dt1==dt2) return 0; if (dt1<dt2) return -1; return 1; }, sort_mmdd: function(a,b) { mtch = a[0].match(sorttable.DATE_RE); y = mtch[3]; d = mtch[2]; m = mtch[1]; if (m.length == 1) m = '0'+m; if (d.length == 1) d = '0'+d; dt1 = y+m+d; mtch = b[0].match(sorttable.DATE_RE); y = mtch[3]; d = mtch[2]; m = mtch[1]; if (m.length == 1) m = '0'+m; if (d.length == 1) d = '0'+d; dt2 = y+m+d; if (dt1==dt2) return 0; if (dt1<dt2) return -1; return 1; }, shaker_sort: function(list, comp_func) { // A stable sort function to allow multi-level sorting of data // see: http://en.wikipedia.org/wiki/Cocktail_sort // thanks to Joseph Nahmias var b = 0; var t = list.length - 1; var swap = true; while(swap) { swap = false; for(var i = b; i < t; ++i) { if ( comp_func(list[i], list[i+1]) > 0 ) { var q = list[i]; list[i] = list[i+1]; list[i+1] = q; swap = true; } } // for t--; if (!swap) break; for(var i = t; i > b; --i) { if ( comp_func(list[i], list[i-1]) < 0 ) { var q = list[i]; list[i] = list[i-1]; list[i-1] = q; swap = true; } } // for b++; } // while(swap) } } /* ****************************************************************** Supporting functions: bundled here to avoid depending on a library ****************************************************************** */ // Dean Edwards/Matthias Miller/John Resig /* for Mozilla/Opera9 */ if (document.addEventListener) { document.addEventListener("DOMContentLoaded", sorttable.init, false); } /* for Internet Explorer */ /*@cc_on @*/ /*@if (@_win32) document.write("<script id=__ie_onload defer src=javascript:void(0)><\/script>"); var script = document.getElementById("__ie_onload"); script.onreadystatechange = function() { if (this.readyState == "complete") { sorttable.init(); // call the onload handler } }; /*@end @*/ /* for Safari */ if (/WebKit/i.test(navigator.userAgent)) { // sniff var _timer = setInterval(function() { if (/loaded|complete/.test(document.readyState)) { sorttable.init(); // call the onload handler } }, 10); } /* for other browsers */ window.onload = sorttable.init; // written by Dean Edwards, 2005 // with input from Tino Zijdel, Matthias Miller, Diego Perini // http://dean.edwards.name/weblog/2005/10/add-event/ function dean_addEvent(element, type, handler) { if (element.addEventListener) { element.addEventListener(type, handler, false); } else { // assign each event handler a unique ID if (!handler.$$guid) handler.$$guid = dean_addEvent.guid++; // create a hash table of event types for the element if (!element.events) element.events = {}; // create a hash table of event handlers for each element/event pair var handlers = element.events[type]; if (!handlers) { handlers = element.events[type] = {}; // store the existing event handler (if there is one) if (element["on" + type]) { handlers[0] = element["on" + type]; } } // store the event handler in the hash table handlers[handler.$$guid] = handler; // assign a global event handler to do all the work element["on" + type] = handleEvent; } }; // a counter used to create unique IDs dean_addEvent.guid = 1; function removeEvent(element, type, handler) { if (element.removeEventListener) { element.removeEventListener(type, handler, false); } else { // delete the event handler from the hash table if (element.events && element.events[type]) { delete element.events[type][handler.$$guid]; } } }; function handleEvent(event) { var returnValue = true; // grab the event object (IE uses a global event object) event = event || fixEvent(((this.ownerDocument || this.document || this).parentWindow || window).event); // get a reference to the hash table of event handlers var handlers = this.events[event.type]; // execute each event handler for (var i in handlers) { this.$$handleEvent = handlers[i]; if (this.$$handleEvent(event) === false) { returnValue = false; } } return returnValue; }; function fixEvent(event) { // add W3C standard event methods event.preventDefault = fixEvent.preventDefault; event.stopPropagation = fixEvent.stopPropagation; return event; }; fixEvent.preventDefault = function() { this.returnValue = false; }; fixEvent.stopPropagation = function() { this.cancelBubble = true; } // Dean's forEach: http://dean.edwards.name/base/forEach.js /* forEach, version 1.0 Copyright 2006, Dean Edwards License: http://www.opensource.org/licenses/mit-license.php */ // array-like enumeration if (!Array.forEach) { // mozilla already supports this Array.forEach = function(array, block, context) { for (var i = 0; i < array.length; i++) { block.call(context, array[i], i, array); } }; } // generic enumeration Function.prototype.forEach = function(object, block, context) { for (var key in object) { if (typeof this.prototype[key] == "undefined") { block.call(context, object[key], key, object); } } }; // character enumeration String.forEach = function(string, block, context) { Array.forEach(string.split(""), function(chr, index) { block.call(context, chr, index, string); }); }; // globally resolve forEach enumeration var forEach = function(object, block, context) { if (object) { var resolve = Object; // default if (object instanceof Function) { // functions have a "length" property resolve = Function; } else if (object.forEach instanceof Function) { // the object implements a custom forEach method so use that object.forEach(block, context); return; } else if (typeof object == "string") { // the object is a string resolve = String; } else if (typeof object.length == "number") { // the object is array-like resolve = Array; } resolve.forEach(object, block, context); } }; //--> </script> </head> <body> <table class="draggable sortable"> <tr> <th>API Name</th> <th class="sorttable_revnumeric" >Cumulative Time(ms)</th> <th class="sorttable_revnumeric" >% of Total Time</th> <th class="sorttable_revnumeric" ># of Calls</th> <th class="sorttable_revnumeric" >Avg Time(ms)</th> <th class="sorttable_revnumeric" >Max Time(ms)</th> <th class="sorttable_revnumeric" >Min Time(ms)</th> </tr> <tr bgcolor = "#FFFFFF"><td>clEnqueueReadBuffer</td> <td>100469.22316</td> <td>94.39770</td> <td>21</td> <td>4784.24872</td> <td>10246.61089</td> <td>0.00126</td> </tr> <tr bgcolor = "#FFFFFF"><td>clBuildProgram</td> <td>5942.19600</td> <td>5.58310</td> <td>1</td> <td>5942.19600</td> <td>5942.19600</td> <td>5942.19600</td> </tr> <tr bgcolor = "#FFFFFF"><td>clCreateCommandQueue</td> <td>17.40373</td> <td>0.01635</td> <td>1</td> <td>17.40373</td> <td>17.40373</td> <td>17.40373</td> </tr> <tr bgcolor = "#FFFFFF"><td>clEnqueueNDRangeKernel</td> <td>1.95404</td> <td>0.00184</td> <td>11</td> <td>0.17764</td> <td>1.83537</td> <td>0.00463</td> </tr> <tr bgcolor = "#FFFFFF"><td>clEnqueueMapBuffer</td> <td>0.72264</td> <td>0.00068</td> <td>5</td> <td>0.14453</td> <td>0.45335</td> <td>0.06108</td> </tr> <tr bgcolor = "#FFFFFF"><td>clEnqueueWriteBuffer</td> <td>0.23948</td> <td>0.00023</td> <td>43</td> <td>0.00557</td> <td>0.02312</td> <td>0.00080</td> </tr> <tr bgcolor = "#FFFFFF"><td>clGetPlatformInfo</td> <td>0.03365</td> <td>0.00003</td> <td>2</td> <td>0.01683</td> <td>0.03224</td> <td>0.00141</td> </tr> <tr bgcolor = "#FFFFFF"><td>clCreateProgramWithSource</td> <td>0.02371</td> <td>0.00002</td> <td>1</td> <td>0.02371</td> <td>0.02371</td> <td>0.02371</td> </tr> <tr bgcolor = "#FFFFFF"><td>clGetDeviceInfo</td> <td>0.01595</td> <td>0.00001</td> <td>4</td> <td>0.00399</td> <td>0.01361</td> <td>0.00052</td> </tr> <tr bgcolor = "#FFFFFF"><td>clCreateBuffer</td> <td>0.01036</td> <td>0.00001</td> <td>5</td> <td>0.00207</td> <td>0.00416</td> <td>0.00105</td> </tr> <tr bgcolor = "#FFFFFF"><td>clGetProgramBuildInfo</td> <td>0.00875</td> <td>0.00001</td> <td>1</td> <td>0.00875</td> <td>0.00875</td> <td>0.00875</td> </tr> <tr bgcolor = "#FFFFFF"><td>clCreateContext</td> <td>0.00802</td> <td>0.00001</td> <td>1</td> <td>0.00802</td> <td>0.00802</td> <td>0.00802</td> </tr> <tr bgcolor = "#FFFFFF"><td>clGetDeviceIDs</td> <td>0.00553</td> <td>0.00001</td> <td>1</td> <td>0.00553</td> <td>0.00553</td> <td>0.00553</td> </tr> <tr bgcolor = "#FFFFFF"><td>clCreateKernel</td> <td>0.00393</td> <td>0.00000</td> <td>1</td> <td>0.00393</td> <td>0.00393</td> <td>0.00393</td> </tr> <tr bgcolor = "#FFFFFF"><td>clSetKernelArg</td> <td>0.00075</td> <td>0.00000</td> <td>5</td> <td>0.00015</td> <td>0.00044</td> <td>0.00006</td> </tr> <tr bgcolor = "#FFFFFF"><td>clGetKernelWorkGroupInfo</td> <td>0.00071</td> <td>0.00000</td> <td>1</td> <td>0.00071</td> <td>0.00071</td> <td>0.00071</td> </tr> </table> </body></html>