// STRINGS

String.prototype.isAnyOf = function(ary){ var obj = this;return ary.any(function(item,indx){return(item==obj);}) };

String.prototype.getExtension = function (){ var indx = this.lastIndexOf('.')+1; if(indx>0){return this.substring(indx).toLowerCase();}else{return '';}; };

String.prototype.getFilePath = function (){ var ret = this;var i = ret.indexOf('://');if(i>-1){ret = ret.substring(i+3);i = ret.indexOf('/');if(i>-1) ret = ret.substring(i);};return ret; };

String.prototype.getServer = function (){ var ret = '';var i = this.indexOf('://');if(i>-1){ret = this.substr(i+3);i = ret.indexOf('/');if(i>-1) ret = ret.substring(0,i);};return ret; };

String.prototype.getFileName = function(){ var indx = this.lastIndexOf('/'); return (indx==-1)?this:this.substr(indx+1); }

String.prototype.contains = function(find){
	return(this.indexOf(find)>-1);
	
};
String.prototype.replaceAll = String.prototype.gsub;

// BROWSER INFO

window.details = {
	innerHeight:function(){
		  if( typeof( window.innerWidth ) == 'number' ) {
		    //Non-IE
		    return window.innerHeight;
		  } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
		    //IE 6+ in 'standards compliant mode'
		    return document.documentElement.clientHeight;
		  } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
		    //IE 4 compatible
		    return document.body.clientHeight;
		  }
	},
	
	innerWidth:function(){
		  if( typeof( window.innerWidth ) == 'number' ) {
		    //Non-IE
		    return window.innerWidth;
		  } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
		    //IE 6+ in 'standards compliant mode'
		    return document.documentElement.clientWidth;
		  } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
		    //IE 4 compatible
		    return document.body.clientWidth;
		  }
	},
	
	scrollTop:function(){
		if( typeof( window.pageYOffset ) == 'number' ) {
			//Netscape compliant
			return window.pageYOffset;
		} else if( document.body && ( document.body.scrollLeft || document.body.scrollTop ) ) {
			//DOM compliant
			return document.body.scrollTop;
		} else if( document.documentElement && ( document.documentElement.scrollLeft || document.documentElement.scrollTop ) ) {
			//IE6 standards compliant mode
			return document.documentElement.scrollTop;
		}
	},
	
	scrollLeft:function(){
		if( typeof( window.pageYOffset ) == 'number' ) {
			//Netscape compliant
			return window.pageXOffset;
		} else if( document.body && ( document.body.scrollLeft || document.body.scrollTop ) ) {
			//DOM compliant
			return document.body.scrollLeft;
		} else if( document.documentElement && ( document.documentElement.scrollLeft || document.documentElement.scrollTop ) ) {
			//IE6 standards compliant mode
			return document.documentElement.scrollLeft;
		}
	},
	
	ieVersion:function()
		// Returns the version of Internet Explorer or a -1
		// (indicating the use of another browser).
		{
		  var rv = -1; // Return value assumes failure.
		  if (navigator.appName == 'Microsoft Internet Explorer')
		  {
		    var ua = navigator.userAgent;
		    var re  = new RegExp("MSIE ([0-9]{1,}[\.0-9]{0,})");
		    if (re.exec(ua) != null)
		      rv = parseFloat( RegExp.$1 );
		  }
		  return rv;
	}
}