Created
June 29, 2009 22:24
-
-
Save alcides/137851 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment