Alcides Fonseca
By: a guest | Aug 25th, 2007 | Syntax:
JavaScript | Size: 0.68 KB | Hits: 220 | Expires: Never
// Prototype extra javascript stuff
// http://alcides.ideias3.com
Position.GetWindowSize = function(w) {
var width, height;
w = w ? w : window;
this.width = w.innerWidth || (w.document.documentElement.clientWidth || w.document.body.clientWidth);
this.height = w.innerHeight || (w.document.documentElement.clientHeight || w.document.body.clientHeight);
return this;
}
String.prototype.trim = function() {
return this.replace(/^\s+|\s+$/g,"");
}
Array.prototype.haskey = function(item) {
var j = 0;
while (j < this.length) {
if (this[j] == item) {
return true;
} else { j++; }
}
return false;
}