// TheGamingLib
if(typeof TheGamingLib=="undefined"){
var TheGamingLib={};
};
// TheGamingLib Browser
TheGamingLib.Browser={
isKHTML:function(){
return ((/Konqueror|KHTML/.test(navigator.userAgent)) && (!/Apple/.test(navigator.userAgent)));
},
isSafari:function(){
return (((/KHTML/.test(navigator.userAgent)) && (/Apple/.test(navigator.userAgent))) && (!this.isChrome()));
},
isChrome:function(){
return (/Chrome/.test(navigator.userAgent));
},
isOpera:function(){
return ((!this.isSafari()) && (typeof window.opera != "undefined"));
},
isIE:function(){
return ((!this.isSafari()) && (typeof document.all != "undefined") && (typeof window.opera == "undefined"));
},
isIEQuirks:function(){
return (this.isIE() && (document.documentElement.clientHeight == 0));
},
isIELessThan7:function(){
var index = navigator.userAgent.indexOf("MSIE");
var version = parseFloat(navigator.userAgent.substring(index + 5));
return (this.isIE() && (version < 7));
},
isIE7:function(){
var index = navigator.userAgent.indexOf("MSIE");
var version = parseFloat(navigator.userAgent.substring(index + 5));
return (this.isIE() && (version >= 7));
},
isGecko:function(){
return (/Gecko/.test(navigator.userAgent) && (!this.isSafari() && !this.isChrome()));
},
isFirefox:function(){
return ((this.isGecko() && /Firefox/.test(navigator.userAgent)) && ((!/Navigator/.test(navigator.userAgent) && (!this.isFlock()))));
},
isFlock:function(){
return (this.isGecko() && /Flock/.test(navigator.userAgent));
},
isNetscape:function(){
return (this.isGecko() && /Navigator/.test(navigator.userAgent));
}
};
// TheGamingLib Browser Info
TheGamingLib.Browser.Info={
getSize:function(){
var iWidth = 0;
var iHeight = 0;
if(typeof(window.innerWidth) == 'number'){
//Non-IE
iWidth = window.innerWidth;
iHeight = window.innerHeight;
}else if(document.documentElement && (document.documentElement.clientWidth || document.documentElement.clientHeight)){
//IE 6+ in 'standards compliant mode'
iWidth = document.documentElement.clientWidth;
iHeight = document.documentElement.clientHeight;
}else if(document.body && (document.body.clientWidth || document.body.clientHeight)){
//IE 4 compatible
iWidth = document.body.clientWidth;
iHeight = document.body.clientHeight;
}
return [iWidth, iHeight];
},
getSizeWidth:function(){
var sSize = this.getSize();
return sSize[0];
},
getSizeHeight:function(){
var sSize = this.getSize();
return sSize[1];
},
getOffset:function() {
var iOfX = 0;
var iOfY = 0;
if(typeof(window.pageYOffset) == 'number'){
//Netscape compliant
iOfX = window.pageXOffset;
iOfY = window.pageYOffset;
}else if(document.body && (document.body.scrollLeft || document.body.scrollTop)){
//DOM compliant
iOfX = document.body.scrollLeft;
iOfY = document.body.scrollTop;
}else if(document.documentElement && (document.documentElement.scrollLeft || document.documentElement.scrollTop)){
//IE6 standards compliant mode
iOfX = document.documentElement.scrollLeft;
iOfY = document.documentElement.scrollTop;
}
return [iOfX, iOfY];
},
getOffsetX:function(){
var sOffset = this.getOffset();
return sOffset[0];
},
getOffsetY:function(){
var sOffset = this.getOffset();
return sOffset[1];
}
};
