var IroCon = function() {
    var agt = navigator.userAgent.toLowerCase();
    var isOP = agt.indexOf("opera")!=-1
    var ieOffset = agt.indexOf("msie");
    var isIE = (ieOffset!=-1&&document.all&&!isOP);
    var isPreIE7 = false;
    if (isIE)
    {
        var fullVersionIE = parseFloat(agt.substring(ieOffset+5, agt.length));
        var majorVersionIE = parseInt('' + fullVersionIE);
        isPreIE7 = majorVersionIE < 7;
    }
    return {
        util : {
            browser : { 
                name : navigator.userAgent,
                isIE : isIE,
                isIE5 : (agt.indexOf("msie 5")!=-1&&document.all&&!isOP),
                isMac : (agt.indexOf("mac")!=-1),
                isOpera : isOP,
                isPreIE7 : isPreIE7,
                isSafari : (agt.indexOf("safari")!=-1),
                getWidth : function() {
                    return window.innerWidth != null? window.innerWidth: document.documentElement && document.documentElement.clientWidth ? document.documentElement.clientWidth:document.body != null? document.body.clientWidth:null;
                },
                getHeight : function() {
                    return window.innerHeight != null? window.innerHeight: document.documentElement && document.documentElement.clientHeight ? document.documentElement.clientHeight:document.body != null? document.body.clientHeight:null;
                },
                getLeft : function() {
                    return typeof window.pageXOffset != 'undefined' ? window.pageXOffset:document.documentElement && document.documentElement.scrollLeft? document.documentElement.scrollLeft:document.body.scrollLeft? document.body.scrollLeft:0;
                },
                getTop : function() {
                    return typeof window.pageYOffset != 'undefined' ? window.pageYOffset:document.documentElement && document.documentElement.scrollTop? document.documentElement.scrollTop: document.body.scrollTop?document.body.scrollTop:0;
                }
            },
            isNullOrEmpty : function(value) {
                return (value == null || value == '');
            },
            ifNullOrEmpty : function(value, alt) {
                return (value == null || value == '') ? alt : value;
            },
            enterKeyCheck : function(e, func) {
                var evt = e ? e : window.event;
                var key = evt.which ? evt.which : evt.keyCode ? evt.keyCode : evt.charCode;
                if (key == 13) {
                    if (func) {
                        func();
                    }
                    key, evt = null;
                    return false;
                }
                key, evt = null;
            },
            isEnterKey : function() {
                var retVal = false;
                var keycode = 0;
                if ((typeof(window.event) != "undefined") && (window.event != null))
                {
                    keycode = window.event.keyCode;
                }
                else if ((typeof(e) != "undefined") && (e != null))
                {
                    keycode = e.which;
                }
                if (keycode == 13)
                {
                    retVal = true;
                }
                return retVal;
            },
            isRightClick : function(e) {
                var retVal = false; 
                e = e ? e : window.event;
                if (e.button && e.button != null && e.button == 2) 
                    retVal = true;
                return retVal;
            }   
        },
        controls : {}
    };
}();
