/*----------------------------------------------------------------------------- | | | shared.js | | | | Think Computer Corporation | | Shared JavaScript Library | | | | Copyright © 2001-2012 Think Computer Corporation. All Rights Reserved. | | | -----------------------------------------------------------------------------*/ if (! ('console' in window)) window.console = { log: function(){}, dir: function(){} }; // Rollovers function flip(image, vertical) { image.style.backgroundPosition='0px ' + vertical + 'px'; } // DIV Visibility function ID(id) { return document.getElementById(id) } function showID(id) { if (document.getElementById) { // DOM3 = IE5, NS6 document.getElementById(id).style.display = 'block'; } else { if (document.layers) { // Netscape 4 document.id.display = 'block'; } else { // IE 4 document.all.id.style.display = 'block'; } } } function hideID(id) { if (document.getElementById) { // DOM3 = IE5, NS6 document.getElementById(id).style.display = 'none'; } else { if (document.layers) { // Netscape 4 document.id.display = 'none'; } else { // IE 4 document.all.id.style.display = 'none'; } } } function hideIDs(prefix, count, start) { for (var i = start; i < start + count; i++) { hideID(prefix + i); } } function showTR(id) { if (document.getElementById) { // DOM3 = IE5, NS6; IE7 doesn't know what a table row is. document.getElementById(id).style.display = (navigator.appName == "Microsoft Internet Explorer" ? 'block' : 'table-row'); } else { if (document.layers) { // Netscape 4 document.id.display = 'table-row'; } else { // IE 4 document.all.id.style.display = 'table-row'; } } } function hideTR(id) { if (document.getElementById) { // DOM3 = IE5, NS6 if (document.getElementById(id)) document.getElementById(id).style.display = 'none'; } else { if (document.layers) { // Netscape 4 if (document.id) document.id.display = 'none'; } else { // IE 4 if (document.all.id) document.all.id.style.display = 'none'; } } } // People function switchProfile(index) { $.get(handler, { "method": "switchProfile", "profileid": index }, function(reply) { if (reply.error) { alert(reply.error) } else { document.location.reload(); } }); } function amendShareList(data, lineid) { if (!data) return false; $.post(handler + '?method=amendShareList', data, function(reply) { if (reply && reply.id && parseInt(reply.id)) { $('#shareList').append(reply.html); } else { alert(data.display + ' is already in the list.'); } }); } function redactShareList(rel) { var arr = rel.split(';'); $.post(handler + '?method=redactShareList', { type: arr[0], id: arr[1] }, function(reply) { if (parseInt(reply + 1)) { $('#shareItem' + parseInt(reply)).remove(); } }); } function selectPerson(li, field, path) { var index = document.forms[1].elements[field + 'Index'].value; document.getElementById(field + 'Results').innerHTML += '
' + li.selectValue + ' Delete
'; document.getElementById(field).value = ''; document.forms[1].elements[field + 'Count'].value++; document.forms[1].elements[field + 'Index'].value++; } function digestPerson(box, event, field) { if (event.keyCode == 13 && box.value != '') { var url = shared + 'javascript/handler.js?method=digestPerson'; var data = {'q': box.value}; $.get(url, data, function(reply) { if (! reply.id) { alert('Please type in a phrase for your tag that is at least three characters long.'); } else { var li = {'selectValue': box.value, 'extra': new Array(1)} li.extra[0] = reply.id; selectPerson(li, field, 'contacts') } }); } } function deletePendingPerson(index, field) { document.getElementById(field + index).innerHTML = ''; } function deleteExistingPerson(index, linkTable) { var url = shared + 'javascript/handler.js?method=deleteTag'; var data = {'id': id, 'l': linkTable, 'index': index}; $.post(url, data, function(reply) { if (! reply) { alert('There was no response from the server.'); } else if (reply.error) { alert(reply.error); } else { deletePendingTag(index); } }); } function makeConnections(id, myid) { initDialog(); $('#connect').show(); } // Products // versionElement: ID of the TR element and also name of the element that contains the dropdown for the versions of the product // onchange: onchange content of the dropdown function updateProduct(formName, productid, versionid, description, versionElement, onchange) { if (document.forms[formName].product) { document.forms[formName].product.value = description; } var params = { 'productid': productid, 'versionid': versionid, 'versionElement': versionElement, 'onchange': onchange }; $.get(handler + '?method=productVersions', params, function(reply) { // note: versionElement is used as an ID here, whereas at the same time, it's used as the name for the dropdown in productVersions document.getElementById(versionElement).cells[1].innerHTML = reply; showTR(versionElement); }); } // Confirmation Dialogs function deleteRecord(phpself, id) { if (confirm("Are you sure you want to delete this record?")) { window.location = phpself + '?delete=1&' + id; } } function actOnRecords(action, tableName, formName) { if (confirm('Are you sure you want to ' + action + ' the selected records?')) { document.forms[formName].elements['table'].value = tableName; document.forms[formName].elements['button'].value = action; document.forms[formName].submit(); } } function invertRecords(formName, hiddenField) { var count = 0, undefined; if (hiddenField != undefined){ $('input[name^="' + hiddenField + '"]').each(function(){ if (parseInt($(this).val()) > 0) count++ }); } if (count == 0 && hiddenField != undefined){ alert('You must select items to invert first.'); } else if (confirm("Are you sure you want to invert the selected records?")) { document.forms[formName].button.value = 'invert'; document.forms[formName].submit(); } } function copyRecords(formName, hiddenField) { var count = 0, undefined; if (hiddenField != undefined) { $('input[name^="' + hiddenField + '"]').each(function() { if (parseInt($(this).val()) > 0) count++ }); } if (count == 0 && hiddenField != undefined){ alert('You must select items to copy first.'); } else if (confirm("Are you sure you want to copy the selected records?")) { document.forms[formName].button.value = 'copy'; document.forms[formName].submit(); } } function updateRecords(formName) { document.forms[formName].button.value = 'update'; document.forms[formName].submit(); } function doneRecords(formName) { if (confirm("Are you sure you want to mark the selected records as done?")) { document.forms[formName].button.value = 'done'; document.forms[formName].submit(); } } function checkEntityBox(box, field, e) { if (box.value.length > 1) { if (e.explicitOriginalTarget != undefined) { // Firefox has a convenient event attribute that tells you what set of the blur event var clickedOnList = e == 1 ? true : e.explicitOriginalTarget.parentElement.className == 'auto-complete-list' || e.explicitOriginalTarget.parentElement.parentElement.className == 'auto-complete-list'; } else { // IE, Chrome and Safari get to use this ungodly hack instead. var clickedOnList = document.activeElement.innerHTML.indexOf('auto-complete-list-rollover') != -1; } // No Entity ID in the hidden field, not coming from a direct click, and not triggered from an onBlur event just before that same click if (ID(field).value == '' && e != 1 && ! clickedOnList) { box.style.cssText = "border: #FFD0D0 solid 1px; background: url('" + static + "images/loading2.gif') right no-repeat; background-color: #FFF0F0; padding-right: 2px;"; $.get(handler, { 'method': 'checkEntityBox', 'field': field, 'value': box.value }, function(reply) { if (reply.error) { alert(reply.error); } else if (reply) { ID(field + 'dialog').innerHTML = reply; $('#' + field + 'dialog').dialog('destroy'); box.style.cssText = "border: #FFD0D0 solid 1px; background-color: #FFF0F0;"; $('#' + field + 'dialog').dialog({ 'title': 'Entity Search', 'modal': true, 'width': 540, 'height': 360, buttons: { Cancel: function() { $(this).dialog('close'); } }, close: function(event, ui) { // Reset the dialog's DIV ID(field + 'dialog').innerHTML = ''; // Do what would have happened if the proper entity were selected fixEntityBox('', '', field); if (ID(field).value == '') { // Still nothing selected ID(field + 'Display').value = ''; box.style.cssText = ''; } } }); } }); } else { box.style.cssText = 'border: #A0D0A0 solid 1px; background-color: #F0FFF0;'; } } } function entityEnter(box, field, e) { if (e.keyCode == 13) { checkEntityBox(box, field, e); $('.auto-complete-list').hide(); return false; } } function fixEntityBox(entityid, value, field) { $('.auto-complete-list').hide(); if (entityid) { ID(field + 'Display').value = value ID(field).value = entityid; } eval(field + 'Select();'); if (entityid) $('#' + field + 'dialog').dialog('close'); } function checkTagBox(box, field, e) { if (box.value.length > 1) { if (e.explicitOriginalTarget != undefined) { // Firefox has a convenient event attribute that tells you what set of the blur event var clickedOnList = e == 1 ? true : e.explicitOriginalTarget.parentElement.className == 'auto-complete-list' || e.explicitOriginalTarget.parentElement.parentElement.className == 'auto-complete-list'; } else { // IE, Chrome and Safari get to use this ungodly hack instead. var clickedOnList = document.activeElement.innerHTML.indexOf('auto-complete-list-rollover') != -1; } // No Entity ID in the hidden field, not coming from a direct click, and not triggered from an onBlur event just before that same click if (ID(field).value == '' && e != 1 && ! clickedOnList) { box.style.cssText = "border: #FFD0D0 solid 1px; background: url('" + static + "images/loading2.gif') right no-repeat; background-color: #FFF0F0; padding-right: 2px;"; $.get(handler, { 'method': 'checkTagBox', 'field': field, 'value': box.value }, function(reply) { if (reply.error) { alert(reply.error); } else if (reply) { ID(field + 'dialog').innerHTML = reply; $('#' + field + 'dialog').dialog('destroy'); box.style.cssText = "border: #FFD0D0 solid 1px; background-color: #FFF0F0;"; $('#' + field + 'dialog').dialog({ 'title': 'Tag Search', 'modal': true, 'width': 540, 'height': 360, buttons: { Cancel: function() { $(this).dialog('close'); } }, close: function(event, ui) { // Reset the dialog's DIV ID(field + 'dialog').innerHTML = ''; // Do what would have happened if the proper entity were selected fixEntityBox('', '', field); if (ID(field).value == '') { // Still nothing selected ID(field + 'Display').value = ''; box.style.cssText = ''; } } }); } }); } else { box.style.cssText = 'border: #A0D0A0 solid 1px; background-color: #F0FFF0;'; } } } function fixTagBox(tagid, value, field) { $('.auto-complete-list').hide(); if (tagid) { ID(field + 'Display').value = value ID(field).value = entityid; } eval(field + 'Select();'); if (tagid) $('#' + field + 'dialog').dialog('close'); } function tagEnter(box, field, e) { if (e.keyCode == 13) { checkTagBox(box, field, e); $('.auto-complete-list').hide(); return false; } } // Pop-Up Windows function openWindow(path, name, width, height, format) { window.open(path, name, "width=" + width + ",height=" + height + "," + format); } // List Boxes function changeSequence(list, to) { var index = list.selectedIndex; var total = list.options.length - 1; if (index == -1) return false; if (to == +1 && index == total) return false; if (to == -1 && index == 0) return false; var items = new Array; var values = new Array; for (i = 0; i <= total; i++) { items[i] = list.options[i].text; values[i] = list.options[i].value; } for (i = 0; i <= total; i++) { list.options[i] = new Option(items[i], values[i]); } list.options[index + to] = new Option(items[index], values[index], 0, 1); list.options[index] = new Option(items[index + to], values[index + to]); list.focus(); } function selectAll(list, value) { for (i = 0; i <= list.options.length - 1; i++) { list.options[i].selected = value; } } // Tabs function showTab(tabGroup, tabName) { var location = 0; var src = ''; if (! tabs) tabs = [[], []]; // Locate ourself in the row - used to test if we need to change right/left ends for (i = 0; i < tabs[0].length; i++) { // Reset all tabs to unselected tabs[1][i] = 2; if (tabs[0][i] == tabName) { tabs[1][i] = 1; location = i; } document.getElementById(tabGroup + 'panel' + i).style.backgroundColor = tabs[1][i] == 3 ? '#FF0000' : '#606060'; document.getElementById(tabGroup + tabs[0][i]).style.display = 'none'; } // Left End if (tabs[1][0] == 3) { document.getElementById(tabGroup + 'leftend').style.backgroundColor = '#FF0000'; } else if (location != 0) { document.getElementById(tabGroup + 'leftend').style.backgroundColor = '#606060'; } else { document.getElementById(tabGroup + 'leftend').style.backgroundColor = '#404040'; } // Right End if (tabs[1][tabs[0].length - 1] == 3) { document.getElementById(tabGroup + 'rightend').src = static + "tabs/rightend3.gif"; } else if (location != (tabs[0].length - 1)) { document.getElementById(tabGroup + 'rightend').src = static + "tabs/rightend2.gif"; } else { document.getElementById(tabGroup + 'rightend').src = static + "tabs/rightend1.gif"; } // Intersections. 2 sides per word - 2 outside ends / 2 var intersections = ((tabs[0].length * 2) - 2) / 2; // Just choose selected ones for (i = 0; i < intersections; i++) { var tab1Color = tabs[1][i] != 3 ? 2 : 3; var tab2Color = i + 1 < tabs[0].length ? tabs[1][i + 1] : false; // Basically, because red is the color for selected AND deselected tabs, we run into this weird naming issue. if (tab1Color == 2 && tab2Color == 3) tab2Color = '3a'; document.getElementById(tabGroup + 'intersection' + i).src = static + "tabs/intersection" + tab1Color + "-" + tab2Color + ".gif"; } // Swap var previousColor = tabs[1][location - 1] == 3 ? 3 : 2; var activeColor = tabs[1][location] == 3 ? 3 : 1; var nextColor = tabs[1][location + 1] == 3 ? 3 : 2; if (location > 0) { document.getElementById(tabGroup + 'intersection' + (location - 1)).src = static + "tabs/intersection" + previousColor + "-" + (activeColor == 3 && previousColor != 3 ? '3b' : activeColor) + ".gif"; if (location < intersections) document.getElementById(tabGroup + 'intersection' + location).src = static + "tabs/intersection" + activeColor + "-" + nextColor + ".gif"; } else { document.getElementById(tabGroup + 'intersection0').src = static + "tabs/intersection" + activeColor + "-" + nextColor + ".gif"; } document.getElementById(tabGroup + 'panel' + location).style.backgroundColor = tabs[1][location] == 3 ? '#FF0000' : '#404040'; document.getElementById(tabGroup + tabName).style.display = 'block'; } // Flash / IE Legal Workaround // Copyright 2006 Adobe Systems, Inc. All rights reserved. Modified by Think Computer Corporation. function AC_Generateobj(objAttrs, params, embedAttrs) { var str = ' '; str += ' 1 ? '.' + x[1] : ''; var rgx = /(\d+)(\d{3})/; while (rgx.test(x1)) { x1 = x1.replace(rgx, '$1' + ',' + '$2'); } return x1 + x2; } // Top Search function selectHomeSearch(data) { if (! data || ! data.type || ! data.id) return false; switch (data.type) { case 'entities': window.location = '/profiles/index.html?id=' + data.id; break; case 'tag': window.location = '/tags/index.html?id=' + data.id; break; } } function selectTopSearchControl(data) { selectTopSearch(data, 1) } function selectTopSearch(data, control) { if (! data || ! data.type || ! data.id) return false; switch (data.type) { case 'entities': window.location = '/profiles/index.html?id=' + data.id; break; case 'contacts': if (parseInt(control) == 1) { window.location = '/control/contacts.html?id=' + data.id; } else { window.location = '/contacts/index.html?id=' + data.id; } break; case 'ap': window.location = '/money/accounting/ap.html?id=' + data.id; break; case 'ar': window.location = '/money/accounting/ar.html?id=' + data.id; break; case 'po': window.location = '/money/purchaseorders/index.html?id=' + data.id; break; case 'assets': window.location = '/money/accounting/assets.html?id=' + data.id; break; case 'employees': window.location = '/money/accounting/payroll/employees.html?id=' + data.id; break; case 'tags': window.location = '/tags/index.html?id=' + data.id; break; default: window.location = '/money/' + data.type + '/index.html?id=' + data.id; break; } } // Lampshade function preload(img) { var a = new Image(); a.src = img; return a; } function rollover(image, value) { eval('document[\'' + image + '\'].src = ' + value + '.src;'); } function turnPurple(formName, imageName, hiddenName, id) { if (document.forms[formName].elements[hiddenName + '[' + id + ']'].value == id) { document[imageName + id].src = arrowgray.src; document.forms[formName].elements[hiddenName + '[' + id + ']'].value = ''; } else { document[imageName + id].src = arrowon.src; document.forms[formName].elements[hiddenName + '[' + id + ']'].value = id; } } function turnOnePurple(formName, imageName, hiddenName, numberArrows, id) { for (var i = 0; i < numberArrows; i++) { document[imageName + i].src = arrowgray.src; } document[imageName + id].src = arrowon.src; } function turnColor(formName, imageName, hiddenName, color) { stringLength = hiddenName.length; elementArray = document.forms[formName].elements; for (i = 0; i < elementArray.length; i++) { if (elementArray[i].name.substr(0, stringLength) == hiddenName) { openBracket = elementArray[i].name.search('\\['); closeBracket = elementArray[i].name.search('\\]'); arrayIndex = elementArray[i].name.substring(openBracket + 1, closeBracket); if (elementArray[i].value == arrayIndex) { eval('document[imageName + arrayIndex].src = arrow' + color + '.src'); } } } } function actionPurple(formName, imageName, hiddenName, id, action) { if (document.forms[formName].elements[hiddenName + '[' + id + ']'].value == id) { document[imageName + id].src = arrowgray.src; document.forms[formName].elements[hiddenName + '[' + id + ']'].value = ''; } else { document[imageName + id].src = arrowon.src; document.forms[formName].elements[hiddenName + '[' + id + ']'].value = id; } eval(action); } function selectAllArrows(formName, imageName, hiddenName) { if (typeof selectAllArrows.status == 'undefined') selectAllArrows.status = false; stringLength = hiddenName.length; elementArray = document.forms[formName].elements; for (i = 0; i < elementArray.length; i++) { if (elementArray[i].name.substr(0, stringLength) == hiddenName) { openBracket = elementArray[i].name.search('\\['); closeBracket = elementArray[i].name.search('\\]'); arrayIndex = elementArray[i].name.substring(openBracket + 1, closeBracket); if (! selectAllArrows.status) { document[imageName + arrayIndex].src = arrowon.src; document.forms[formName].elements[hiddenName + '[' + arrayIndex + ']'].value = arrayIndex; } else { document[imageName + arrayIndex].src = arrowgray.src; document.forms[formName].elements[hiddenName + '[' + arrayIndex + ']'].value = ''; } } } selectAllArrows.status = ! selectAllArrows.status; } function showNextDrop(obj, k) { var $span = $(obj).next('span').eq(0), disp = $span.css('display'); if (disp == 'none') { $span.show(); $('#filtertriangle' + k).hide(); } else { $span.hide(); $('#filtertriangle' + k).show(); } } function startTopSearch(text) { if (! text.length) { ID('topSearch').style.cssText = ID('topSearch').style.cssText.replace(' background: url(\'' + static + 'images/loading2.gif\'); background-position: 99% 50%; background-repeat: no-repeat; padding-right: 2px;', ''); } else if (text.length >= 2) { if (text.match(/(.+)@(.+)\.(.+)/)) { ID('topSearch').style.cssText = "homeField"; ID('topSearch').name = "signinemail"; showID('topSignIn'); } else { ID('topSearch').style.cssText += " background: url('" + static + "images/loading2.gif'); background-position: 99% 50%; background-repeat: no-repeat; padding-right: 2px;"; } } return text; } function thinkPrompt(box) { var query = box.value; if (window.thinklink == undefined) window.thinklink = { 'state': false, 'step': false }; box.value = ''; if (window.thinklink.state == 'signin' && window.thinklink.step == 'password') { ID('above').innerHTML += "
[Password]
"; } else { ID('above').innerHTML += "
" + query + "
"; } if (query.toLowerCase() == 'clear') { ID('above').innerHTML = ''; return true; } $.get(handler, { 'method': 'thinkPrompt', 'q': query }, function(reply) { if (reply.error) { alert(reply.error) } else if (reply.above) { ID('above').innerHTML += "
" + reply.above + "
"; } else if (reply.below) { ID('below').innerHTML += "
" + reply.below + "
"; } else if (reply.redirect) { window.location = reply.redirect; } if (reply.state) window.thinklink.state = reply.state; if (reply.step) window.thinklink.step = reply.step; if (window.thinklink.state == 'signin' && window.thinklink.step == 'password') { ID('topSearch').type = 'password'; } else { ID('topSearch').type = 'text'; } }); } // jQuery plugins ;(function($){ /* * Metadata - jQuery plugin for parsing metadata from elements * * Copyright (c) 2006 John Resig, Yehuda Katz, J?örn Zaefferer, Paul McLanahan * * Dual licensed under the MIT and GPL licenses: * http://www.opensource.org/licenses/mit-license.php * http://www.gnu.org/licenses/gpl.html * * Revision: $Id: jquery.metadata.js 3640 2007-10-11 18:34:38Z pmclanahan $ */ $.extend({ metadata : { defaults : { type: 'class', name: 'metadata', cre: /({.*})/, single: 'metadata' }, setType: function( type, name ){ this.defaults.type = type; this.defaults.name = name; }, get: function( elem, opts ){ var settings = $.extend({},this.defaults,opts); // check for empty string in single property if ( !settings.single.length ) settings.single = 'metadata'; var data = $.data(elem, settings.single); // returned cached data if it already exists if ( data ) return data; data = "{}"; var getData = function(data) { if(typeof data != "string") return data; if( data.indexOf('{') < 0 ) { data = eval("(" + data + ")"); } } var getObject = function(data) { if(typeof data != "string") return data; data = eval("(" + data + ")"); return data; } if ( settings.type == "html5" ) { var object = {}; $( elem.attributes ).each(function() { var name = this.nodeName; if(name.match(/^data-/)) name = name.replace(/^data-/, ''); else return true; object[name] = getObject(this.nodeValue); }); } else { if ( settings.type == "class" ) { var m = settings.cre.exec( elem.className ); if ( m ) data = m[1]; } else if ( settings.type == "elem" ) { if( !elem.getElementsByTagName ) return; var e = elem.getElementsByTagName(settings.name); if ( e.length ) data = $.trim(e[0].innerHTML); } else if ( elem.getAttribute != undefined ) { var attr = elem.getAttribute( settings.name ); if ( attr ) data = attr; } object = getObject(data.indexOf("{") < 0 ? "{" + data + "}" : data); } $.data( elem, settings.single, object ); return object; } } }); /** * Returns the metadata object for the first member of the jQuery object. * * @name metadata * @descr Returns element's metadata object * @param Object opts An object contianing settings to override the defaults * @type jQuery * @cat Plugins/Metadata */ $.fn.metadata = function( opts ){ return this[0] ? $.metadata.get( this[0], opts ) : {}; }; // Timer Function $.fn.timerup = function(){ return this.each(function(){ var $obj = $(this), arr = $obj.html().split(':'), str = '', second = arr.length ? parseInt(arr.pop()) : 0, minute = arr.length ? parseInt(arr.pop()) : 0, hour = arr.length ? parseInt(arr.pop()) : 0; // Timer second++; if (second > 59){ second = 0; minute++; if (minute > 59){ minute = 0; hour++; } if (minute < 10) minute = '0'+minute; } str = (hour > 0) ? hour+':' : ''; str += (hour > 0 && minute < 10) ? '0'+minute+':' : minute+':'; str += (second < 10) ? '0'+second : second; $obj.html(str); }); }; })(jQuery); /*! * Auto Complete 4.1 * October 5, 2009 * Corey Hart @ http://www.codenothing.com */ // Seperate out to prevent name collisions ;(function($, undefined){ // Expose autoComplete to the jQuery chain $.fn.autoComplete = function(){ // Force array of arguments var args = Array.prototype.slice.call(arguments); // Autocomplete special triggers if (typeof args[0] === 'string') // Trigger the requested function, and dont break the chain! return $(this).trigger('autoComplete.'+args.shift(), args); // Initiate the autocomplete return autoComplete.call(this, args[0]); }; // bgiframe is needed to fix z-index problem for IE6 users. $.fn.bgiframe = $.fn.bgiframe ? $.fn.bgiframe : $.fn.bgIframe ? $.fn.bgIframe : function(){ // For applications that don't have bgiframe plugin installed, create a useless // function that doesn't break the chain return this; }; // Autocomplete function var inputIndex = 0, autoComplete = function(options){ return this.each(function(){ // Cache objects var $input = $(this).attr('autocomplete', 'off'), $li, timeid, timeid2, blurid, xhr, // Internal Per Input Cache cache = { length: 0, val: undefined, list: {} }, // Set defaults and include metadata support settings = $.extend({ // Inner Function Defaults (Best to leave alone) opt: -1, inputval: undefined, mouseClick: false, dataName: 'ac-data', inputIndex: ++inputIndex, // Server Script Path ajax: 'ajax.php', dataSupply: [], dataFn: undefined, // Drop List CSS list: 'auto-complete-list', rollover: 'auto-complete-list-rollover', width: $input.outerWidth() > 8 ? $input.outerWidth() - 2 : $input[0].size * 7, // Post Data postVar: 'value', postData: {}, // Limitations minChars: 1, maxItems: -1, maxRequests: 0, requestType: 'post', requests: 0, // Inner Function Default // Events onMaxRequest: function(){}, onSelect: function(){}, onRollover: function(){}, onBlur: function(){}, onFocus: function(){}, inputControl: function(v){return v;}, preventEnterSubmit: false, enter: true, // Inner Function Default delay: 100, selectFuncFire: true, // Inner Function Default // Caching Options useCache: true, cacheLimit: 50, // Last element option noResultsFound: undefined }, options||{}, $.metadata ? $input.metadata() : {}), // Create the drop list (Use an existing one if possible) $ul = $('ul.'+settings.list)[0] ? $('ul.'+settings.list).bgiframe() : $('