var $ = function(elementID) {
	if (elementID && elementID != "")
		return document.getElementById(elementID);
	return null;
};
var addLoadEvent = function(func) {
    var oldonload = window.onload;
    if (typeof window.onload != 'function') {
        window.onload = func;
    } else {
        window.onload = function() {
            if (oldonload) {
                oldonload();
            }
            func();
        };
    }
};
var addResizeEvent = function(func) {
    addLoadEvent(func);
    var oldonresize = window.onresize;
    if (typeof window.onresize != 'function') {
        window.onresize = func;
    } else {
        window.onresize = function() {
            if (oldonresize) {
                oldonresize();
            }
            func();
        };
    }
};
var getWidth = function() {
    var width = 00;
    if (typeof( window.innerWidth ) == 'number') {
        //Non-IE
        width = window.innerWidth;
    } else if (document.documentElement && document.documentElement.clientWidth) {
        //IE 6+ in 'standards compliant mode'
        width = document.documentElement.clientWidth;
    } else if (document.body && document.body.clientWidth || document.body.clientWidth) {
        //IE 4 compatible
        width = document.body.clientWidth;
    }
    return width;
};
var getHeight = function() {
    var height = 00;
    if (typeof( window.innerWidth ) == 'number') {
        //Non-IE
        height = window.innerHeight;
    } else if (document.documentElement && document.documentElement.clientHeight) {
        //IE 6+ in 'standards compliant mode'
        height = document.documentElement.clientHeight;
    } else if (document.body && document.body.clientHeight) {
        //IE 4 compatible
        height = document.body.clientHeight;
    }
    return height;
};
function lib_bwcheck() {
    this.ver = navigator.appVersion;
    this.agent = navigator.userAgent;
    this.dom = document.getElementById ? 1 : 0;
    this.ie5 = (this.ver.indexOf("MSIE 5") > -1 && this.dom) ? 1 : 0;
    this.ie6 = (this.ver.indexOf("MSIE 6") > -1 && this.dom) ? 1 : 0;
    this.ie7 = (this.ver.indexOf("MSIE 7") > -1 && this.dom) ? 1 : 0;
    this.ie4 = (document.all && !this.dom) ? 1 : 0;
    this.ie = this.ie4 || this.ie5 || this.ie6;
    this.mac = this.agent.indexOf("Mac") > -1;
    this.opera_ = this.agent.indexOf("Opera") > -1;
    this.ns6 = (this.dom && parseInt(this.ver) >= 5) ? 1 : 0;
    this.ns4 = (document.layers && !this.dom) ? 1 : 0;
    this.ns = this.ns4 || this.ns6;
    this.bw = (this.ie6 || this.ie5 || this.ie4 || this.ns4 || this.ns6 || this.opera || this.dom);
    return this;
}
var bw = new lib_bwcheck();
