var CBC = {
    Init: function () {

        this.ShowHide.Toggle();
        CBC.Popup.Init();
    },
    ShowHide: {
        Toggle: function () {
            $('#showData').click(function () {
                
                $('#hiddenContent').slideToggle();
                
            });
        }
    },
    Popup: {
        els: [],
        rel: [],
        classRef: "popMeUp",
        width: "716",
        height: "482",
        _width: "",
        _height: "",
        Init: function () {
            CBC.Popup.els = document.getElementsByTagName('a');
            var x = 0;
            for (var i = 0; i < CBC.Popup.els.length; i++) {
                if (CBC.Popup.els[i].className.indexOf(CBC.Popup.classRef) > -1) {
                    CBC.Popup.els[i].onclick = function () {
                        CBC.Popup.CreateInfo(this);
                        return false;
                    };
                };
            };
        },
        CreateInfo: function (el) {
            var url = el.href;
            var infoOverlay = this;
            infoOverlay = document.createElement('div');
            infoOverlay.className = "infoOverlay";
            infoOverlay.style.width = document.body.clientWidth + 'px';
            if (navigator.appName.indexOf("Microsoft") == -1) {
                infoOverlay.style.height = window.innerHeight + 20 + 'px';
            }
            else {
                infoOverlay.style.height = document.body.clientHeight + 'px';
            };
            var infoContainer = this;
            infoContainer = document.createElement('div');
            infoContainer.className = "infoContainer";
            infoContainer.style.width = document.documentElement.clientWidth + "px";
            infoContainer.style.height = document.documentElement.clientHeight + "px";
            var infoHolder = this;
            infoHolder = document.createElement('div');
            infoHolder.className = "infoHolder";

            var content = this;
            if (el.rel != "") {
                var rel = this;
                eval("rel = {" + el.rel + "}");
                if (rel.height) { var height = rel.height; } else { var height = CBC.Popup.height; };
                if (rel.width) { var width = rel.width; } else { var width = CBC.Popup.width; };
                if (rel.scroll) { var scroll = rel.scroll; } else { var scroll = "no"; };
                content = "<iframe src= " + url + " width=" + width + " height=" + height + " scrolling=" + scroll + " frameborder=\"0\" align=\"left\" class=\"iFrame\" />";
                infoHolder.style.height = height + "px";
                infoHolder.style.width = width + "px";
                infoHolder.style.marginTop = "-" + height / 2 + "px";
                infoHolder.style.marginLeft = "-" + width / 2 + "px";
            }
            else {
                content = "<iframe src= " + url + " width=" + CBC.Popup.width + " height=" + CBC.Popup.height + " scrolling=\"no\" frameborder=\"0\"  align=\"left\" class=\"iFrame\" />";
                infoHolder.style.height = CBC.Popup.height + "px";
                infoHolder.style.width = CBC.Popup.width + "px";
                infoHolder.style.marginTop = "-" + CBC.Popup.height / 2 + "px";
                infoHolder.style.marginLeft = "-" + CBC.Popup.width / 2 + "px";
            };
            infoHolder.innerHTML = content;
            var infoClose = this;
            infoClose = document.createElement('div');
            infoClose.className = "infoClose";
            infoHolder.appendChild(infoClose);
            infoOverlay.onclick = function () {
                document.body.removeChild(infoOverlay);
            };
            infoClose.onclick = function () {
                document.body.removeChild(infoOverlay);
            };
            infoContainer.appendChild(infoHolder);
            infoOverlay.appendChild(infoContainer);
            document.body.appendChild(infoOverlay);
        }
    }
};
	
	