// TRIM PROTOTYPE // USAGE: string.trim() String.prototype.trim = function() { return this.replace(/^\s*|\s*$/g,''); } // IN_ARRAY PROTOTYPE // USAGE: haystack.in_array("needle") = TRUE or FALSE Array.prototype.in_array = function(obj) { for(var x=0; x<=this.length; x++) { if(this[x] == obj) return true; } return false; } // GET_POSITION PROTOTYPE // USAGE: haystack.get_position("needle") // NOTE: same as in_array, but returns index position (or FALSE) Array.prototype.get_position = function(obj) { for(var x=0; x
'); $('body').append(div); var w1 = $('div',div).innerWidth(); div.css('overflow-y','scroll'); var w2 = $('div',div).innerWidth(); $(div).remove(); return (navigator.userAgent.match(/Safari/i)) ? 16 : (w1-w2); //return(w1-w2); }