2 * JavaScript for core functions
3 * --------------------------------------------------------------------
8 * --------------------------------------------------------------------
9 * Copyright (c) 2003 - 2009 by Roland Haeder
10 * Copyright (c) 2009 - 2012 by Mailer Developer Team
11 * For more information visit: http://mxchange.org
13 * This program is free software; you can redistribute it and/or modify
14 * it under the terms of the GNU General Public License as published by
15 * the Free Software Foundation; either version 2 of the License, or
16 * (at your option) any later version.
18 * This program is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU General Public License for more details.
23 * You should have received a copy of the GNU General Public License
24 * along with this program; if not, write to the Free Software
25 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
29 // Function similar to PHP's function, except it checks only numeric indexes
30 function in_array (needle, heystack) {
31 // By default it is not found
32 var isInArray = false;
35 for (var i = 0; i < heystack.length; i++) {
36 // Is the element found?
37 if (heystack[i] === needle) {
48 // Function similar to PHP's urldecode() function
49 function decodeUrlEncoding (content) {
50 // Replace plus signs with spaces
51 var removedPlus = (content + '').replace(/\+/g, '%20');
54 var decoded = decodeURIComponent(removedPlus);
60 // "Getter" for total elements in given object
61 function getTotalCountFromObject (object) {
66 $.each(object, function (i, j) {