
if (!window.Guidance) {
    Guidance = new Object();
}


/**
* Common
*/
Guidance.Common = function() { }

Guidance.Common.prototype = {

    get: function(id) {
        return document.getElementById(id);
    },

    getLocation: function(ele) {
        var location = { left: 0, top: 0 };
        var el = ele;
        while (el) {
            location.left += parseInt(el.offsetLeft);
            location.top += parseInt(el.offsetTop);
            el = el.offsetParent;
        }

        return location;
    },

    getBounds: function(ele) {
        var bounds = { width: 0, height: 0 };
        bounds.width = parseInt(ele.offsetWidth);
        bounds.height = parseInt(ele.offsetHeight);

        return bounds;
    },

    getElementsByClassName: function(ele, className) {
        var eles = [];
        for (var i = 0; i < ele.childNodes.length; i++) {
            if (ele.childNodes[i].className == className) {
                eles.push(ele.childNodes[i]);
            }
        }

        return eles;
    },

    getCurrentStyle: function(element, attribute, defaultValue) {
        var currentValue = null;
        if (element) {
            if (element.currentStyle) {
                currentValue = element.currentStyle[attribute];
            } else if (document.defaultView && document.defaultView.getComputedStyle) {
                var style = document.defaultView.getComputedStyle(element, null);
                if (style) {
                    currentValue = style[attribute];
                }
            }

            if (!currentValue && element.style.getPropertyValue) {
                currentValue = element.style.getPropertyValue(attribute);
            }
            else if (!currentValue && element.style.getAttribute) {
                currentValue = element.style.getAttribute(attribute);
            }
        }

        if ((!currentValue || currentValue == "" || typeof (currentValue) === 'undefined')) {
            if (typeof (defaultValue) != 'undefined') {
                currentValue = defaultValue;
            }
            else {
                currentValue = null;
            }
        }
        return currentValue;
    },

    getElementOpacity: function(element) {
        var hasOpacity = false;
        var opacity;

        if (element.filters) {
            var filters = element.filters;
            if (filters.length !== 0) {
                var alphaFilter = filters['DXImageTransform.Microsoft.Alpha'];
                if (alphaFilter) {
                    opacity = alphaFilter.opacity / 100.0;
                    hasOpacity = true;
                }
            }
        }
        else {
            opacity = this.getCurrentStyle(element, 'opacity', 1);
            hasOpacity = true;
        }

        if (hasOpacity === false) {
            return 1.0;
        }
        return parseFloat(opacity);
    },

    setElementOpacity: function(element, value) {
        if (!element) {
            throw Error.argumentNull('element');
        }

        if (element.filters) {
            var filters = element.filters;
            var createFilter = true;
            if (filters.length !== 0) {
                var alphaFilter = filters['DXImageTransform.Microsoft.Alpha'];
                if (alphaFilter) {
                    createFilter = false;
                    alphaFilter.opacity = value * 100;
                }
            }
            if (createFilter) {
                element.style.filter = 'progid:DXImageTransform.Microsoft.Alpha(opacity=' + (value * 100) + ')';
            }
        }
        else {
            element.style.opacity = value;
        }
    },

    addListener: function(element, eventName, handler) {
        if (element.attachEvent) {
            element.attachEvent("on" + eventName, handler);
        }
        else if (element.addEventListener) {
            element.addEventListener(eventName, handler, false);
        }
    },

    createDelegate: function(instance, method, params) {
        if (arguments.length == 2) {
            return function() {
                method.call(instance);
            }
        }
        else if (arguments.length == 3) {
            return function() {
                method.apply(instance, params);
            }
        }
    }
}

$Common = new Guidance.Common();


/**
* NewsManager
*/
//Guidance.newsContents = [
//    "Lorem ipsum sed porta cursus pede cum sociis natoque penatibus et magnis dis parturient cum sociis natoque.",
//    "Lporta cursus pede cum sociis natoque penatibus et magnis dis parturient cum sociis natoque montes.",
//    "Lorem ipsum sed porta cursatoque penatibus et magnis dis parturient cum sociis natoque montes.",
//    "Lorem ipue penatibus et magnis cum sociis natoque montes.",
//    "Lorem ipue penatibus et magnis cum sociis tes."
//];

var NewsContent = new Array();
var NewsLink = new Array();

if (typeof irxmlnewsreleases != 'undefined' && irxmlnewsreleases.length > 0) {

    var i = 0;
    var newsArray = [''];
    var total = 5;
    var flg = true;
    var cnt = 0;
    while (i < total) {

        newsrelease = irxmlnewsreleases[i];
        
        for (j = 0; j < newsArray.length; j++) {
            if (newsArray[j].toString() == newsrelease.releaseid) {
                total++;
                flg = false;
            }
        }
        
        if (flg) {
            downloadUrl = 'http://investors.guidancesoftware.com/releasedetail.cfm?ReleaseID=' + newsrelease.releaseid;
            //downloadUrl = 'http://investor.shareholder.com/common/download/download.cfm?companyid=GUID'
                        //+ '&amp;fileid=' + newsrelease.attachmentfileid
                        //+ '&amp;filekey=' + newsrelease.attachmentfilekey
                        //+ '&amp;filename=' + escape(newsrelease.attachmentfilename).replace(/[+]/g, '%2B');
            NewsContent[cnt] = newsrelease.title;
            NewsLink[cnt] = downloadUrl;
            cnt++;
        }

        flg = true;
        i++;
    }
}

Guidance.News = function() {
    this._news = [
					{ link: "link1", content: NewsContent[0], LinkTo: NewsLink[0] },
					{ link: "link2", content: NewsContent[1], LinkTo: NewsLink[1] },
					{ link: "link3", content: NewsContent[2], LinkTo: NewsLink[2] },
					{ link: "link4", content: NewsContent[3], LinkTo: NewsLink[3] },
					{ link: "link5", content: NewsContent[4], LinkTo: NewsLink[4] }
				];
    this._content = $Common.get("newsContent");
    this._currentIndex = -1;
    this._interval = 5000;
    this._timer = null;
}

//Guidance.News = function() {
//    this._news = [
//					{ link: "link1", content: Guidance.newsContents[0], LinkTo: Guidance.newsLinks[0] },
//					{ link: "link2", content: Guidance.newsContents[1], LinkTo: Guidance.newsLinks[1] },
//					{ link: "link3", content: Guidance.newsContents[2], LinkTo: Guidance.newsLinks[2] },
//					{ link: "link4", content: Guidance.newsContents[3], LinkTo: Guidance.newsLinks[3] },
//					{ link: "link5", content: Guidance.newsContents[4], LinkTo: Guidance.newsLinks[4] }
//				];
//    this._content = $Common.get("newsContent");
//    this._currentIndex = -1;
//    this._interval = 5000;
//    this._timer = null;
//}

Guidance.News.prototype = {
    focusLink: function(index) {
        for (var i = 0; i < this._news.length; i++) {
            $Common.get(this._news[i].link).style.fontWeight = "normal";
        }
        $Common.get(this._news[index].link).style.fontWeight = "bold";
    },

    change: function(index) {
        if (this._timer) {
            clearTimeout(this._timer);
        }
        this.focusLink(index);
        this._currentIndex = index;
        $Common.setElementOpacity(this._content, 0);


        var lnk = this._news[index].content + "<a href='" + this._news[index].LinkTo + "' target='_new' style='margin-left:5px; font-family:Arial; font-size:11px; color:#006699;'>Read More</a>";
        //alert(lnk);
        //alert(this._content.innerHTML);
        this._content.innerHTML = this._news[index].content + "<a href='" + this._news[index].LinkTo + "' target='_new' style='margin-left:5px; font-family:Arial; font-size:11px; color:#006699;'>Read More</a>";
        this.onShow();
    },

    autoChange: function() {
        if (this._timer) {
            clearTimeout(this._timer);
        }
        this._currentIndex = this._currentIndex == 4 || this._currentIndex == -1 ? 0 : this._currentIndex + 1;
        this.focusLink(this._currentIndex);
        $Common.setElementOpacity(this._content, 0);
        this._content.innerHTML = this._news[this._currentIndex].content + "<a href='" + this._news[this._currentIndex].LinkTo + "' target='_new' style='margin-left:5px; font-family:Arial; font-size:11px; color:#006699;'>Read More</a>";
        this.onShow();
    },

    onShow: function() {
        if (this._timer) {
            clearTimeout(this._timer);
        }
        if (this._currentIndex != -1) {
            var opacity = $Common.getElementOpacity(this._content);
            if (opacity < 0.9) {
                $Common.setElementOpacity(this._content, opacity + 0.1);
                setTimeout($Common.createDelegate(this, this.onShow), 100);
            }
            else {
                this._timer = setTimeout($Common.createDelegate(this, this.autoChange), this._interval);
            }
        }
    }
}

/**
* NavigationMenu
*/
Guidance.NavigationMenuContainer = function() {
    //create container
	this._item = document.createElement("div");
	this._item.style.position = "absolute";
	this._item.style.width = "100%";
	this._item.style.height = "100%";
	this._item.style.left = "0px";
    this._item.style.top = "0px";
	this._item.style.display = "none";
}

Guidance.NavigationMenuContainer.prototype = {

    getItem: function() {
        return this._item;
    },

    show: function() {
        this._item.style.display = "block";
    },

    hide: function() {
        this._item.style.display = "none";
    }
	
}


/**
* NavigationMenu
*/
Guidance.NavigationMenuHeader = function(sender, width, text, topAdjust, leftAdjust) {
    this._sender = sender;
    this._width = width;
    //this._height = height;
    this._text = text;
    this._topAdjust = topAdjust;
    this._leftAdjust = leftAdjust;

    // create popup
    this._item = document.createElement("div");
    this._item.style.position = "absolute";
    this._item.style.zIndex = 10000;
    this._item.style.width = this._width + "px";
    this._item.className = "NavigationMenuHeader";
    this._item.innerHTML = '<table cellpadding="0" cellspacing="0" border="0" width="100%">' +
                                '<tr>' +
                                    '<td><img src="images/bar/1_left.png"></td>' +
                                    '<td style="width:' + (width - 10) + 'px; height:30px; background-image:url(images/bar/1_med.png); text-align:center">' +
                                        '<span style="font-size:13px; font-family:arial; font-weight:bold; color:White">' + text + '</span>' +
                                    '</td>' +
                                    '<td><img src="images/bar/1_right.png" /></td>' +
                                '</tr>' +
                            '</table>';
    this._item.style.display = "none";
}

Guidance.NavigationMenuHeader.prototype = {

    getSender: function() {
        return this._sender;
    },

    getItem: function() {
        return this._item;
    },

    show: function() {
        this.setLocation();
        this._item.style.display = "block";
    },

    hide: function() {
        this._item.style.display = "none";
    },

    setLocation: function() {
        var location = $Common.getLocation(this._sender);
        this._item.style.left = location.left - this._leftAdjust + "px";
        this._item.style.top = location.top - this._topAdjust + "px";
    }
}

Guidance.NavigationMenuItem = function(text, url) {
    this._text = text;
    this._url = url;

    //create item
    this._item = document.createElement("div");
    this._item.className = "NavigationMenuItem";
    this._item.innerHTML = text;
    //    this._link = document.createElement("a");
    //    this._link.href = url;
    //    this._link.innerHTML = text;
    //    this._link.style.color = "#e6e6e6";
    //    this._link.style.textDecoration = "none";
    //    this._item.appendChild(this._link);

    this.addHandlers();
}

Guidance.NavigationMenuItem.prototype = {

    getSender: function() {
        return this._sender;
    },

    getItem: function() {
        return this._item;
    },

    addHandlers: function() {
        $Common.addListener(this._item, "mouseover", $Common.createDelegate(this, this.onMouseOver));
        $Common.addListener(this._item, "mouseout", $Common.createDelegate(this, this.onMouseOut));
        $Common.addListener(this._item, "click", $Common.createDelegate(this, this.onClick));
    },

    onMouseOver: function() {
        //this._link.style.color = "white";
        this._item.style.backgroundImage = "url(images/bar/3.png)";

    },

    onMouseOut: function() {
        //this._link.style.color = "#e6e6e6";
        this._item.style.backgroundImage = "url(images/bar/2.png)";
    },

    onClick: function() {
        window.location = this._url;
    }
}

Guidance.NavigationMenuBody = function(sender, width, topAdjust, leftAdjust, items) {
    this._sender = sender;
    this._width = width;
    this._topAdjust = topAdjust;
    this._leftAdjust = leftAdjust;
    this._items = items;

    // create body
    this._item = document.createElement("div");
    this._item.style.position = "absolute";
    this._item.style.zIndex = 10000;
    this._item.style.width = this._width + "px";
    for (var i = 0; i < this._items.length; i++) {
        this._item.appendChild(this._items[i].getItem());
    }
    this._item.style.display = "none";
}

Guidance.NavigationMenuBody.prototype = {

    getSender: function() {
        return this._sender;
    },

    getItem: function() {
        return this._item;
    },

    show: function() {
        this.setLocation();
        this._item.style.display = "block";
    },

    hide: function() {
        this._item.style.display = "none";
    },

    setLocation: function() {
        var location = $Common.getLocation(this._sender);
        this._item.style.left = location.left - this._leftAdjust + "px";
        this._item.style.top = location.top - this._topAdjust + "px";
    }
}

/**
* headerConfig: {width, text, topAdjust, leftAdjust}
* bodyConfig: {width, topAdjust, leftAdjust, items}     
*/
Guidance.NavigationMenu = function(sender, headerConfig, bodyConfig) {
    this._sender = sender;
	this._container = new Guidance.NavigationMenuContainer();
    this._header = new Guidance.NavigationMenuHeader(sender, headerConfig.width, headerConfig.text, headerConfig.topAdjust, headerConfig.leftAdjust);
    this._body = new Guidance.NavigationMenuBody(sender, bodyConfig.width, bodyConfig.topAdjust, bodyConfig.leftAdjust, bodyConfig.items);
	
	
	document.body.appendChild(this._container.getItem());
	document.body.appendChild(this._header.getItem());
    document.body.appendChild(this._body.getItem());
}

Guidance.NavigationMenu.prototype = {
    getSender: function() {
        return this._sender;
    },

    getHeader: function() {
        return this._header;
    },

    getBody: function() {
        return this._body;
    },
	
	getContainer: function()
	{
		return this._container;
	},

    show: function() {
        this._header.show();
        this._body.show();
		this._container.show();
    },

    hide: function() {
        this._header.hide();
        this._body.hide();
		this._container.hide();
    }
}

Guidance.NavigationMenuList = function(menuItems) {
    this._menuItems = menuItems;

    for (var i = 0; i < menuItems.length; i++) {
        //$Common.addListener(menuItems[i].getHeader().getItem(), "mouseover", $Common.createDelegate(this, this.menuItemMouseOver, [menuItems[i]]));
        //$Common.addListener(menuItems[i].getBody().getItem(), "mouseover", $Common.createDelegate(this, this.menuItemMouseOver, [menuItems[i]]));
        //$Common.addListener(menuItems[i].getHeader().getItem(), "focus", $Common.createDelegate(this, this.menuItemMouseOver, [menuItems[i]]));
        //$Common.addListener(menuItems[i].getBody().getItem(), "focus", $Common.createDelegate(this, this.menuItemMouseOver, [menuItems[i]]));
        $Common.addListener(menuItems[i].getContainer().getItem(), "mouseover", $Common.createDelegate(this, this.menuItemMouseOut, [menuItems[i]]));
        //$Common.addListener(menuItems[i].getBody().getItem(), "mouseout", $Common.createDelegate(this, this.menuItemMouseOut, [menuItems[i]]));
        //$Common.addListener(menuItems[i].getHeader().getItem(), "blur", $Common.createDelegate(this, this.menuItemMouseOut, [menuItems[i]]));
        //$Common.addListener(menuItems[i].getBody().getItem(), "blur", $Common.createDelegate(this, this.menuItemMouseOut, [menuItems[i]]));
        //$Common.addListener(menuItems[i].getHeader().getItem(), "mousemove", $Common.createDelegate(this, this.menuItemMouseMove, [menuItems[i]]));
        //$Common.addListener(menuItems[i].getBody().getItem(), "mousemove", $Common.createDelegate(this, this.menuItemMouseMove, [menuItems[i]]));
        $Common.addListener(menuItems[i].getSender(), "mouseover", $Common.createDelegate(this, this.onMouseOver, [menuItems[i]]));
        $Common.addListener(menuItems[i].getSender(), "mouseout", $Common.createDelegate(this, this.onMouseOut, [menuItems[i]]));
    }

    this._showMenu = false;
}

Guidance.NavigationMenuList.prototype = {

    getItems: function() {
        return this._menuItems;
    },

    menuItemMouseOver: function(menu) {
        menu.show();
    },

    menuItemMouseOut: function(menu) {
        menu.hide();
    },

    menuItemMouseMove: function(menu) {
        menu.show();
    },

    onMouseOver: function(menu) {
        this._showMenu = true;
        setTimeout($Common.createDelegate(this, this.showMenu, [menu]), 200);
    },

    onMouseOut: function(menu) {
        this._showMenu = false;
    },

    showMenu: function(menu) {
        if (this._showMenu) {
            for (var i = 0; i < this._menuItems.length; i++) {
                this._menuItems[i].hide();
            }
            menu.show();
        }
    }
}
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/**
* Accordion
*/
Guidance.AccordionTab = function(tab) {
    this._tab = tab;
    this._activeImage = $Common.getElementsByClassName(tab, "Active").length > 0 ? $Common.getElementsByClassName(tab, "Active")[0] : null;
    this._inactiveImage = $Common.getElementsByClassName(tab, "Inactive").length > 0 ? $Common.getElementsByClassName(tab, "Inactive")[0] : null;
    this.inactive();
}

Guidance.AccordionTab.prototype = {

    getTab: function() {
        return this._tab;
    },

    active: function() {
        this._activeImage.style.display = "block";
        this._inactiveImage.style.display = "none";
    },

    inactive: function() {
        this._activeImage.style.display = "none";
        this._inactiveImage.style.display = "block";
    }
}

/**
* Accordion Content
*/
Guidance.AccordionContent = function(content) {

    this._content = content;

    this._text = $Common.getElementsByClassName(content, "AccordionText")[0];
    this._bottom = $Common.getElementsByClassName(content, "AccordionBottom")[0];
}

Guidance.AccordionContent.prototype = {

    getContent: function() {
        return this._content;
    },

    getText: function() {
        return this._text;
    },

    getBottom: function() {
        return this._bottom;
    }
}

/**
* Accordion Panel
*/
Guidance.AccordionPanel = function(panel) {
    this._panel = panel;

    var tab = $Common.getElementsByClassName(panel, "AccordionPanelTab").length > 0 ? $Common.getElementsByClassName(panel, "AccordionPanelTab")[0] : null;
    this._tab = tab ? new Guidance.AccordionTab(tab) : null;

    var content = $Common.getElementsByClassName(panel, "AccordionPanelContent").length > 0 ? $Common.getElementsByClassName(panel, "AccordionPanelContent")[0] : null;
    this._content = content ? new Guidance.AccordionContent(content) : null;
    if (this._content) {
        this._content.getContent().style.height = "0px";
        this._content.getContent().style.display = "none";
    }
}

Guidance.AccordionPanel.prototype = {

    getTab: function() {
        return this._tab;
    },

    getContent: function() {
        return this._content;
    }
}

/**
* Accordion
*/
Guidance.Accordion = function(accordionId) {

    this._accordion = $Common.get(accordionId);
    this._maxHeight = this._accordion.getAttribute("contentheight");

    var panels = $Common.getElementsByClassName(this._accordion, "AccordionPanel");

    this._panels = [];
    for (var i = 0; i < panels.length; i++) {
        this._panels.push(new Guidance.AccordionPanel(panels[i]));
    }

    if (this._panels.length > 0) {
        this._panels[0].getTab().active();
        this._panels[0].getContent().getContent().style.height = this._maxHeight + "px";
        this._panels[0].getContent().getContent().style.display = "block";
    }

    this._interval = 10;
    this._step = 50;
    this._opening = false;

    this._closingPanel = this._panels[0];
    this._openingPanel = null;

    this.initBehaviors();
}

Guidance.Accordion.prototype = {

    initBehaviors: function() {
        for (var i = 0; i < this._panels.length; i++) {
            $Common.addListener(this._panels[i].getTab().getTab(), "click", $Common.createDelegate(this, this.switchPanel, [this._panels[i]]));
        }
    },

    switchPanel: function(panel) {
        if (this._closingPanel != panel && !this._opening) {
            this._openingPanel = panel;
            this._openingPanel.getTab().active();
            this._openingPanel.getContent().getContent().style.display = "block";
            this._openingPanel.getContent().getText().style.display = "none";
            this._openingPanel.getContent().getBottom().style.display = "none";
            $Common.setElementOpacity(this._openingPanel.getContent().getContent(), 1);
            this._closingPanel.getTab().inactive();
            this._closingPanel.getContent().getText().style.display = "none";
            this._closingPanel.getContent().getBottom().style.display = "none";
            $Common.setElementOpacity(this._closingPanel.getContent().getContent(), 1);
            this._opening = true;
            this.onSwitch();
        }
    },

    onSwitch: function() {
        if (parseInt(this._closingPanel.getContent().getContent().style.height) > parseInt(this._step)) {
            this._closingPanel.getContent().getContent().style.height = parseInt(this._closingPanel.getContent().getContent().style.height) - parseInt(this._step) + "px";
            this._openingPanel.getContent().getContent().style.height = parseInt(this._openingPanel.getContent().getContent().style.height) + parseInt(this._step) + "px";

            setTimeout($Common.createDelegate(this, this.onSwitch), this._interval);
        }
        else {
            this._closingPanel.getContent().getContent().style.height = "0px";
            this._closingPanel.getContent().getContent().style.display = "none";
            this._openingPanel.getContent().getContent().style.height = this._maxHeight + "px";
            this.onShow();
        }
    },

    onShow: function() {
        var opacity = $Common.getElementOpacity(this._openingPanel.getContent().getContent());

        this._openingPanel.getContent().getText().style.display = "block";
        this._openingPanel.getContent().getBottom().style.display = "block";
        this._closingPanel.getContent().getText().style.display = "block";
        this._closingPanel.getContent().getBottom().style.display = "block";

        this._closingPanel = this._openingPanel;
        this._opening = false;

    }
}

//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/**
* Guidance.MenuBox
*/
Guidance.MenuBox = function(senderId, headerInnerHTML, headerStyle, bodyInnerHTML, bodyStyle, topAdjust, leftAdjust, bodyLeftAdjust, headerHeight, focusId) {
    this._sender = $Common.get(senderId);
    this._sender.style.cursor = "pointer";
    this._topAdjust = topAdjust;
    this._leftAdjust = leftAdjust;
    this._bodyLeftAdjust = bodyLeftAdjust;
    this._headerHeight = headerHeight;
    this._bodyInnerHTML = bodyInnerHTML;
    this._focusId = focusId;
    // create header
    this._header = document.createElement("div");
    this._header.style.position = "absolute";
    this._header.style.zIndex = 10000;
    this._header.style.cursor = "pointer";
    this._header.className = headerStyle;
    this._header.innerHTML = headerInnerHTML;
    this._header.style.display = "none";

    // create body
    this._body = document.createElement("div");
    this._body.style.position = "absolute";
    this._body.style.zIndex = 10000;
    this._body.className = bodyStyle;
    this._body.innerHTML = bodyInnerHTML;
    this._body.style.display = "none";

    document.body.appendChild(this._header);
    document.body.appendChild(this._body);

    this._showMenuBox = false;

    this.addHandlers();
}

Guidance.MenuBox.prototype = {

    addHandlers: function() {
        $Common.addListener(this._sender, "mouseover", $Common.createDelegate(this, this.onMouseOver));
        $Common.addListener(this._sender, "mouseout", $Common.createDelegate(this, this.onMouseOut));
        $Common.addListener(this._header, "mouseover", $Common.createDelegate(this, this.onItemMouseOver));
        $Common.addListener(this._header, "mouseout", $Common.createDelegate(this, this.onItemMouseOut));
        $Common.addListener(this._body, "mouseover", $Common.createDelegate(this, this.onItemMouseOver));
        $Common.addListener(this._body, "mouseout", $Common.createDelegate(this, this.onItemMouseOut));
        $Common.addListener(this._header, "focus", $Common.createDelegate(this, this.onItemMouseOver));
        $Common.addListener(this._header, "blur", $Common.createDelegate(this, this.onItemMouseOut));
        $Common.addListener(this._body, "focus", $Common.createDelegate(this, this.onItemMouseOver));
        $Common.addListener(this._body, "blur", $Common.createDelegate(this, this.onItemMouseOut));
    },

    setLocation: function() {
        var location = $Common.getLocation(this._sender);

        this._header.style.top = location.top - this._topAdjust + "px";
        this._header.style.left = location.left - this._leftAdjust + "px";
        this._body.style.top = location.top - this._topAdjust + this._headerHeight + "px";
        this._body.style.left = location.left - this._bodyLeftAdjust + "px";
    },

    onMouseOver: function() {
        //debugger;
        this._body.innerHTML = this._bodyInnerHTML;


        this._showMenuBox = true;
        setTimeout($Common.createDelegate(this, this.fireMouseOver), 100);
    },

    onMouseOut: function() {
        this._showMenuBox = false;
    },

    onItemMouseOver: function() {
        this._header.style.display = "block";
        this._body.style.display = "block";
        if (this._focusId) {
            $Common.get(this._focusId).focus();
        }
    },

    onItemMouseOut: function() {
        this._header.style.display = "none";
        this._body.style.display = "none";
    },

    fireMouseOver: function() {
        if (this._showMenuBox) {

            this.setLocation();
            this._header.style.display = "block";
            this._body.style.display = "block";
            if (this._focusId) {
                $Common.get(this._focusId).focus();
            }
        }
    }
}

//Guidance.MenuBox.menuList = [];
Guidance.MenuBoxList = function(menuBoxList, homeMenuContainer) {



    this._menuBoxList = menuBoxList;

    for (var i = 0; i < this._menuBoxList.length; i++) {

        $Common.addListener(this._menuBoxList[i]._sender, "mouseover", $Common.createDelegate(this, this.onMouseOver, [this._menuBoxList[i]]));

        $Common.addListener(this._menuBoxList[i]._sender, "mouseout", $Common.createDelegate(this._menuBoxList[i], this._menuBoxList[i].onMouseOut));

        $Common.addListener(this._menuBoxList[i]._header, "mouseover", $Common.createDelegate(this._menuBoxList[i], this._menuBoxList[i].onItemMouseOver));

        $Common.addListener(this._menuBoxList[i]._header, "mouseout", $Common.createDelegate(this._menuBoxList[i], this._menuBoxList[i].onItemMouseOut));

        $Common.addListener(this._menuBoxList[i]._body, "mouseover", $Common.createDelegate(this._menuBoxList[i], this._menuBoxList[i].onItemMouseOver));

        $Common.addListener(this._menuBoxList[i]._body, "mouseout", $Common.createDelegate(this._menuBoxList[i], this._menuBoxList[i].onItemMouseOut));

        $Common.addListener(this._menuBoxList[i]._header, "focus", $Common.createDelegate(this._menuBoxList[i], this._menuBoxList[i].onItemMouseOver));

        $Common.addListener(this._menuBoxList[i]._header, "blur", $Common.createDelegate(this._menuBoxList[i], this._menuBoxList[i].onItemMouseOut));

        $Common.addListener(this._menuBoxList[i]._body, "focus", $Common.createDelegate(this._menuBoxList[i], this._menuBoxList[i].onItemMouseOver));

        $Common.addListener(this._menuBoxList[i]._body, "blur", $Common.createDelegate(this._menuBoxList[i], this._menuBoxList[i].onItemMouseOut));

    }


    this._homeMenuContainer = homeMenuContainer;
    if (this._homeMenuContainer) {
        $Common.addListener(this._homeMenuContainer, "mouseout", $Common.createDelegate(this, this.hideAll));
    }


}

Guidance.MenuBoxList.prototype = {

    onMouseOver: function(menuBox) {

        for (var i = 0; i < this._menuBoxList.length; i++) {

            this._menuBoxList[i]._header.style.display = "none";

            this._menuBoxList[i]._body.style.display = "none";



        }

        menuBox.onMouseOver();

    },

    hideAll: function() {
        for (var i = 0; i < this._menuBoxList.length; i++) {
            this._menuBoxList[i]._header.style.display = "none";
            this._menuBoxList[i]._body.style.display = "none";
        }
    }



}

// Modal Window
Guidance.ModalWindow = function(title, width, height, targetUrl, imageUrls, hdnButtonID) {

    this._background = null;
    this._container = null;
    this._header = null;
    this._btnClose = null;
    this._body = null;
    this._footer = null;
    this._containerLocation = null;
    this._iframe = null;

    // Param variables
    this._title = title;
    this._width = width;
    this._height = height;
    this._targetUrl = targetUrl;
    this._hdnButtonID = hdnButtonID;

    // Images
    this._btnCloseUpImageUrl = "images/btn_close_up.png";
    this._btnCloseOverImageUrl = "images/btn_close_over.png";
    // use for blank title:
    // this._titleImgUrl = "images/popuptitleblank.jpg";
    this._titleImgUrl = "images/contactme.jpg";
    this._headerBackgroundUrl = "images/contact_1.png"
    this._bodyBackgroundUrl = "images/contact_2.jpg";
    this._footerBackgroundUrl = "images/contact_3.png";

    // If a set of custom defined
    // images are passed, use those.
    if (imageUrls != null) {

        if (imageUrls["button.CloseUp"] != null &&
            imageUrls["button.CloseUp"] != "") {

            this._btnCloseUpImageUrl = imageUrls["button.CloseUp"];
        }

        if (imageUrls["button.CloseOver"] != null &&
            imageUrls["button.CloseOver"] != "") {

            this._btnCloseOverImageUrl = imageUrls["button.CloseOver"];
        }

        if (imageUrls["header.Title"] != null) {

            if (imageUrls["header.Title"] != "")
                this._titleImgUrl = imageUrls["header.Title"];
            else
                this._titleImgUrl = "images/modal_window_pixel_border.jpg";
        }

        if (imageUrls["header.Background"] != null &&
            imageUrls["header.Background"] != "") {

            this._headerBackgroundUrl = imageUrls["header.Background"];
        }

        if (imageUrls["body.Background"] != null &&
            imageUrls["body.Background"] != "") {

            this._bodyBackgroundUrl = imageUrls["body.Background"];
        }

        if (imageUrls["footer.Background"] != null &&
            imageUrls["footer.Background"] != "") {

            this._footerBackgroundUrl = imageUrls["footer.Background"];
        }
    }

    this.initialize();
}

Guidance.ModalWindow.prototype = {

    initialize: function() {

        var bounds = $Common.getClientBounds(document.body);

        //initialize background
        this._background = document.createElement('div');

        this._background.style.position = 'absolute';
        this._background.style.zIndex = 9999;
        this._background.style.width = bounds.width + 'px';
        this._background.style.height = bounds.height + 'px';
        this._background.style.left = '0px';
        this._background.style.top = '0px';

        this._background.style.backgroundColor = "#4c4c4c";
        this._background.style.opacity = "0.5";
        this._background.style.filter = "alpha(opacity=50)";
        this._background.style.display = 'none';
        document.body.appendChild(this._background);

        //initialize container
        if (document.getElementById("popcontainer"))
            document.body.removeChild(document.getElementById("popcontainer"));

        this._container = document.createElement('div');
        this._container.id = "popcontainer";
        this._container.style.position = 'absolute';
        this._container.style.zIndex = 10000;
        this._container.style.width = this._width + 'px';
        this._container.style.height = this._height + 41 + 29 + 'px';
        //        this._container.style.backgroundColor = "red";

        this._container.style.display = 'none';
        var x = bounds.width - parseInt(this._container.style.width);
        var y = bounds.height - parseInt(this._container.style.height);
        x = x > 0 ? x / 2 : 0;
        y = y > 0 ? y / 2 : 0;
        this._containerLocation = { x: x, y: y };
        document.body.appendChild(this._container);

        //initialize header
        this._header = document.createElement('div');
        this._header.style.position = 'relative';
        this._header.style.width = this._width + 'px';
        this._header.style.height = '41px';
        this._header.style.left = '0px';
        this._header.style.top = '0px';

        //this._header.style.backgroundImage = "url(images/contact_1.jpg)";
        this._header.style.backgroundImage = "url(" + this._headerBackgroundUrl + ")";
        this._header.innerHTML = this._title;

        this._container.appendChild(this._header);

        //initialize title
        var imgTitle = document.createElement('img');
        imgTitle.style.position = 'absolute';
        imgTitle.style.top = '15px';
        imgTitle.style.left = '15px';

        imgTitle.src = this._titleImgUrl;
        this._header.appendChild(imgTitle);

        //initialize close button
        this._btnClose = document.createElement('img');
        this._btnClose.style.position = 'absolute';
        this._btnClose.style.top = '10px';
        this._btnClose.style.right = '15px';
        this._btnClose.style.cursor = "pointer";
        this._btnClose.src = this._btnCloseUpImageUrl;

        $Common.addListener(this._btnClose, "click", $Common.createDelegate(this, this.hide));
        $Common.addListener(this._btnClose, "mouseover", $Common.createDelegate(this, this.onCloseImgMouseover));
        $Common.addListener(this._btnClose, "mouseout", $Common.createDelegate(this, this.onCloseImgMouseout));
        this._header.appendChild(this._btnClose);

        //initialize body
        this._body = document.createElement('div');
        this._body.style.position = 'relative';
        this._body.style.height = this._height + 'px';
        this._body.style.width = this._width + 'px';
        this._body.style.top = '0px';
        this._body.style.left = '0px';
        //this._body.style.backgroundImage = "url(images/contact_2.jpg)"
        this._body.style.backgroundImage = "url(" + this._bodyBackgroundUrl + ")";

        this._container.appendChild(this._body);

        //initialize body
        this._footer = document.createElement('div');
        this._footer.style.position = 'relative';
        this._footer.style.height = '29px';
        this._footer.style.width = this._width + 'px';
        this._footer.style.top = '0px';
        this._footer.style.left = '0px';
        //this._footer.style.backgroundImage = "url(images/contact_3.jpg)"
        this._footer.style.backgroundImage = "url(" + this._footerBackgroundUrl + ")";

        this._container.appendChild(this._footer);

        //initialize iframe
        this._iframe = document.createElement('iframe');

        this._iframe.style.borderStyle = 'none';
        this._iframe.frameBorder = '0';
        this._iframe.style.marginLeft = '0px';
        this._iframe.style.marginTop = '0px';
        this._iframe.style.width = this._width - 35 + 'px';
        this._iframe.style.height = this._height + 'px';
        this._iframe.style.left = '0px';
        this._iframe.style.top = '0px';
        this._iframe.style.marginLeft = "20px";
        this._iframe.src = this._targetUrl;
        this._body.appendChild(this._iframe);

        $Common.addListener(window, "resize", $Common.createDelegate(this, this._layout));
        $Common.addListener(window, "scroll", $Common.createDelegate(this, this._layout));

        //new Ext.dd.DDProxy(this._container.id, [this._header.id]);

        this._layout();

    },
    show: function() {
    
        this._layout();
        this._background.style.display = 'block';

        this._container.style.display = 'block';
        //        document.body.style.overflow = "hidden";
    },
    hide: function() {
    
        this._background.style.display = 'none';
        this._container.style.display = 'none';

        if (this._hdnButtonID != null &&
            this._hdnButtonID != "") {

            SimulateSubmit(this._hdnButtonID);
        }
    },


    _layout: function() {
        var bounds = $Common.getClientBounds();
        var scroll = $Common.getClientScroll();

        this._background.style.width = bounds.width + 'px';
        this._background.style.height = bounds.height + 'px';
        this._background.style.left = scroll.left + 'px';
        this._background.style.top = scroll.top + 'px';

        var x = bounds.width - parseInt(this._container.style.width);
        var y = bounds.height - parseInt(this._container.style.height);
        this._containerLocation.x = x > 0 ? x / 2 : 0;
        this._containerLocation.y = y > 0 ? y / 2 : 0;

        this._container.style.left = this._containerLocation.x + scroll.left + 'px';
        this._container.style.top = this._containerLocation.y + scroll.top + 'px';


    },
    onCloseImgMouseover: function() {
        this._btnClose.src = this._btnCloseOverImageUrl;
    },
    onCloseImgMouseout: function() {
        this._btnClose.src = this._btnCloseUpImageUrl;
    }
}

//Guidance.ModalWindow = function(title, width, height, targetUrl) {

//    this._background = null;
//    this._container = null;
//    this._header = null;
//    this._btnClose = null;
//    this._body = null;
//    this._footer = null;
//    this._iframe = null;

//    //variables
//    this._title = title;
//    this._width = width;
//    this._height = height;
//    this._targetUrl = targetUrl;

//    //others
//    this._btnClose = null;
//    this._btnCloseUpImageUrl = 'images/btn_close_up.png';
//    this._btnCloseOverImageUrl = 'images/btn_close_over.png';

//    this._titleImgUrl = "images/contactme.jpg";
//    this._containerLocation = null;

//    this.initialize();
//}

//Guidance.ModalWindow.prototype = {


//    initialize: function() {

//        var bounds = $Common.getClientBounds(document.body);

//        //initialize background
//        this._background = document.createElement('div');

//        this._background.style.position = 'absolute';
//        this._background.style.zIndex = 9999;
//        this._background.style.width = bounds.width + 'px';
//        this._background.style.height = bounds.height + 'px';
//        this._background.style.left = '0px';
//        this._background.style.top = '0px';

//        this._background.style.backgroundColor = "#4c4c4c";
//        this._background.style.opacity = "0.5";
//        this._background.style.filter = "alpha(opacity=50)";
//        this._background.style.display = 'none';
//        document.body.appendChild(this._background);



//        //initialize container
//        if (document.getElementById("popcontainer")) {
//            document.body.removeChild(document.getElementById("popcontainer"));
//        }
//        this._container = document.createElement('div');
//        this._container.id = "popcontainer";
//        this._container.style.position = 'absolute';
//        this._container.style.zIndex = 10000;
//        this._container.style.width = this._width + 'px';
//        this._container.style.height = this._height + 41 + 29 + 'px';
//        //        this._container.style.backgroundColor = "red";

//        this._container.style.display = 'none';
//        var x = bounds.width - parseInt(this._container.style.width);
//        var y = bounds.height - parseInt(this._container.style.height);
//        x = x > 0 ? x / 2 : 0;
//        y = y > 0 ? y / 2 : 0;
//        this._containerLocation = { x: x, y: y };
//        document.body.appendChild(this._container);

//        //initialize header
//        this._header = document.createElement('div');
//        this._header.style.position = 'relative';
//        this._header.style.width = this._width + 'px';
//        this._header.style.height = '41px';
//        this._header.style.left = '0px';
//        this._header.style.top = '0px';

//        this._header.style.backgroundImage = "url(images/contact_1.jpg)";
//        this._header.innerHTML = this._title;

//        this._container.appendChild(this._header);

//        //initialize title
//        var imgTitle = document.createElement('img');
//        imgTitle.style.position = 'absolute';
//        imgTitle.style.top = '15px';
//        imgTitle.style.left = '15px';

//        imgTitle.src = this._titleImgUrl;
//        this._header.appendChild(imgTitle);

//        //initialize close button
//        this._btnClose = document.createElement('img');
//        this._btnClose.style.position = 'absolute';
//        this._btnClose.style.top = '10px';
//        this._btnClose.style.right = '15px';
//        this._btnClose.style.cursor = "pointer";
//        this._btnClose.src = this._btnCloseUpImageUrl;

//        $Common.addListener(this._btnClose, "click", $Common.createDelegate(this, this.hide));
//        $Common.addListener(this._btnClose, "mouseover", $Common.createDelegate(this, this.onCloseImgMouseover));
//        $Common.addListener(this._btnClose, "mouseout", $Common.createDelegate(this, this.onCloseImgMouseout));
//        this._header.appendChild(this._btnClose);

//        //initialize body
//        this._body = document.createElement('div');
//        this._body.style.position = 'relative';
//        this._body.style.height = this._height + 'px';
//        this._body.style.width = this._width + 'px';
//        this._body.style.top = '0px';
//        this._body.style.left = '0px';
//        this._body.style.backgroundImage = "url(images/contact_2.jpg)"

//        this._container.appendChild(this._body);

//        //initialize body
//        this._footer = document.createElement('div');
//        this._footer.style.position = 'relative';
//        this._footer.style.height = '29px';
//        this._footer.style.width = this._width + 'px';
//        this._footer.style.top = '0px';
//        this._footer.style.left = '0px';
//        this._footer.style.backgroundImage = "url(images/contact_3.jpg)"

//        this._container.appendChild(this._footer);

//        //initialize iframe
//        this._iframe = document.createElement('iframe');

//        this._iframe.style.borderStyle = 'none';
//        this._iframe.frameBorder = '0';
//        this._iframe.style.marginLeft = '0px';
//        this._iframe.style.marginTop = '0px';
//        this._iframe.style.width = this._width - 35 + 'px';
//        this._iframe.style.height = this._height + 'px';
//        this._iframe.style.left = '0px';
//        this._iframe.style.top = '0px';
//        this._iframe.style.marginLeft = "20px";
//        this._iframe.src = this._targetUrl;
//        this._body.appendChild(this._iframe);

//        $Common.addListener(window, "resize", $Common.createDelegate(this, this._layout));
//        $Common.addListener(window, "scroll", $Common.createDelegate(this, this._layout));

//        //new Ext.dd.DDProxy(this._container.id, [this._header.id]);

//        this._layout();

//    },
//    show: function() {
//        this._layout();
//        this._background.style.display = 'block';

//        this._container.style.display = 'block';
//        //        document.body.style.overflow = "hidden";
//    },
//    hide: function() {
//        this._background.style.display = 'none';

//        this._container.style.display = 'none';
//    },


//    _layout: function() {
//        var bounds = $Common.getClientBounds();
//        var scroll = $Common.getClientScroll();

//        this._background.style.width = bounds.width + 'px';
//        this._background.style.height = bounds.height + 'px';
//        this._background.style.left = scroll.left + 'px';
//        this._background.style.top = scroll.top + 'px';

//        var x = bounds.width - parseInt(this._container.style.width);
//        var y = bounds.height - parseInt(this._container.style.height);
//        this._containerLocation.x = x > 0 ? x / 2 : 0;
//        this._containerLocation.y = y > 0 ? y / 2 : 0;

//        this._container.style.left = this._containerLocation.x + scroll.left + 'px';
//        this._container.style.top = this._containerLocation.y + scroll.top + 'px';


//    },
//    onCloseImgMouseover: function() {
//        this._btnClose.src = this._btnCloseOverImageUrl;
//    },
//    onCloseImgMouseout: function() {
//        this._btnClose.src = this._btnCloseUpImageUrl;
//    }
//}


/**
* Guidance.UI
*/
Guidance.UI = {};

Guidance.UI.initNews = function() {
    Guidance.News.instance = new Guidance.News();
    Guidance.News.instance.autoChange();
}

Guidance.UI.createPopupMenu = function() {
    var senders = [$Common.get("nav1"),
                    $Common.get("nav2"),
                    $Common.get("nav3"),
                    $Common.get("nav4"),
                    $Common.get("nav5"),
                    $Common.get("nav6"),
                    $Common.get("nav7")
                  ];
    var item1 = new Guidance.NavigationMenu(senders[0],
                                            { width: 120, text: "PRODUCTS", topAdjust: 5, leftAdjust: 5 },
                                            { width: 250, topAdjust: -25, leftAdjust: 5, items: [
                                                new Guidance.NavigationMenuItem("EnCase&#174; Enterprise Platform", "computer-forensics-fraud-investigation-software.htm"),
                                                new Guidance.NavigationMenuItem("EnCase&#174; eDiscovery", "computer-forensics-ediscovery-software-frcp.htm"),
                                                new Guidance.NavigationMenuItem("EnCase&#174; Cybersecurity", "computer-forensics-cybersecurity-software-dcid-fisma.htm"),
                                                new Guidance.NavigationMenuItem("EnCase&#174; Forensic", "computer-forensics-ediscovery-software-digital-evidence.htm"),
                                                new Guidance.NavigationMenuItem("EnCase&#174; Portable", "encase-portable.htm")
                                            ]
                                            });
    var item2 = new Guidance.NavigationMenu(senders[1],
                                            { width: 118, text: "TRAINING", topAdjust: 5, leftAdjust: 3 },
                                            { width: 160, topAdjust: -25, leftAdjust: 3, items: [
                                                new Guidance.NavigationMenuItem("Training Overview", "computer-forensics-training.htm"),
                                                new Guidance.NavigationMenuItem("Course Offerings", "computer-forensics-training-courses.htm"),
                                                new Guidance.NavigationMenuItem("Course Schedule", "computer-forensics-training-classes.htm"),
                                                new Guidance.NavigationMenuItem("Training Programs", "computer-forensics-training-programs.htm"),
                                                new Guidance.NavigationMenuItem("Certification Programs", "computer-forensics-training-certifications.htm"),
                                                new Guidance.NavigationMenuItem("Certifying Organizations", "computer-forensics-training-certifying-organizations.htm"),
                                                new Guidance.NavigationMenuItem("Training Partners", "computer-forensics-training-partners.htm")
                                            ]
                                            });
    var item3 = new Guidance.NavigationMenu(senders[2],
                                            { width: 112, text: "SERVICES", topAdjust: 5, leftAdjust: 4 },
                                            { width: 150, topAdjust: -25, leftAdjust: 4, items: [
                                                new Guidance.NavigationMenuItem("Professional Services", "guidance-software-professional-services.htm"),
                                                new Guidance.NavigationMenuItem("eDiscovery", "ediscovery-services.htm"),
                                                new Guidance.NavigationMenuItem("Advisory Program", "Guidance-Software-Advisory-Program-GAP.aspx"),
                                                new Guidance.NavigationMenuItem("Forensic", "computer-forensics-investigation-record-management-services.htm"),
                                                new Guidance.NavigationMenuItem("Incident Response", "computer-security-breach-incident-response-services.htm"),
                                                new Guidance.NavigationMenuItem("Data Auditing", "data-audit-policy-enforcement-services.htm"),
                                                new Guidance.NavigationMenuItem("Customized Solution", "computer-forensics-software-customization.htm")
                                            ]
                                            });
    var item4 = new Guidance.NavigationMenu(senders[3],
                                            { width: 125, text: "RESOURCES", topAdjust: 5, leftAdjust: 3 },
                                            { width: 170, topAdjust: -25, leftAdjust: 3, items: [
                                                new Guidance.NavigationMenuItem("Demos", "resources-demos.htm"),
                                                new Guidance.NavigationMenuItem("Webinars", "resources-webinars.htm"),
                                                new Guidance.NavigationMenuItem("Brochures", "resources-brochures.htm"),
                                                new Guidance.NavigationMenuItem("Whitepapers", "resources-whitepapers.htm"),
                                                new Guidance.NavigationMenuItem("Real eDiscovery Magazine", "WorkArea/DownloadAsset.aspx?id=2854"),
                                                new Guidance.NavigationMenuItem("EnCase&#174; Legal Journal", "WorkArea/DownloadAsset.aspx?id=2525")
                                            ]
                                            });
    var item5 = new Guidance.NavigationMenu(senders[4],
                                            { width: 168, text: "CUSTOMER CENTER", topAdjust: 5, leftAdjust: 4 },
                                            { width: 190, topAdjust: -25, leftAdjust: 4, items: [
                                                new Guidance.NavigationMenuItem("Customer Service", "customer-service.htm"),
                                                new Guidance.NavigationMenuItem("Technical Support", "technical-support.htm"),
                                                new Guidance.NavigationMenuItem("CEIC Conference", "http://www.ceicconference.com/"),
                                                new Guidance.NavigationMenuItem("Training", "computer-forensics-training.htm"),
                                                new Guidance.NavigationMenuItem("Professional Services", "guidance-software-professional-services.htm"),
                                                new Guidance.NavigationMenuItem("Product Registration", "myaccount/registration.aspx")
                                            ]
                                            });
    var item6 = new Guidance.NavigationMenu(senders[5],
                                            { width: 120, text: "PARTNERS", topAdjust: 5, leftAdjust: 3 },
                                            { width: 165, topAdjust: -25, leftAdjust: 3, items: [
                                                new Guidance.NavigationMenuItem("Channel Partner Program", "worldwide-channel-program.htm"),
                                                new Guidance.NavigationMenuItem("Channel Partners", "worldwide-channel-partners.htm"),
                                                new Guidance.NavigationMenuItem("Channel Partner Portal", "http://resellers.guidancesoftware.com/login.aspx")
                                            ]
                                            });
    var item7 = new Guidance.NavigationMenu(senders[6],
                                            { width: 128, text: "ABOUT US", topAdjust: 5, leftAdjust: 3 },
                                            { width: 123, topAdjust: -25, leftAdjust: 3, items: [
                                                 new Guidance.NavigationMenuItem("Blogs", "blogs.htm"),
                                                 new Guidance.NavigationMenuItem("Company Overview", "computer-forensics-ediscovery-leader.htm"),
                                                 new Guidance.NavigationMenuItem("Management", "management.htm"),
                                                 new Guidance.NavigationMenuItem("Newsroom", "computer-forensics-ediscovery-news.htm"),
                                                 new Guidance.NavigationMenuItem("Events Calendar", "computer-forensics-ediscovery-events.htm"),
                                                 new Guidance.NavigationMenuItem("Careers", "https://careers.guidancesoftware.com"),
                                                 new Guidance.NavigationMenuItem("Investors", "http://investors.guidancesoftware.com/"),
                                                 new Guidance.NavigationMenuItem("Contact Us", "contact.htm")

                                            ]
                                            });

    var menuList = new Guidance.NavigationMenuList([item1, item2, item3, item4, item5, item6, item7]);
}

Guidance.UI.initAccordion = function() {
    new Guidance.Accordion("Accordion1", 285);
}

Guidance.UI.initMenuBox = function() {
    var links = "<table cellpadding='3' cellspacing='2' width='100%' style='text-align:left; font-family:arial; padding-left:10px'>" +
                    "<tr>" +
                        "<td style='color:#faa564; font-weight:bold; font-size:13px'><span style='margin-left:10px'>Products</span></td>" +
                        "<td style='color:#faa564; font-weight:bold; font-size:13px'>Services</td>" +
                        "<td style='color:#faa564; font-weight:bold; font-size:13px'>Resources</td>" +
                    "</tr>" +
                    "<tr>" +
                        "<td class='DemoMenuBox' style='color:#666666; font-weight:bold; font-size:12px'><a href='#' style='margin-left:10px'>Product One</a><br /><span style='font-size:10px; font-weight:normal; color:white; margin-left:10px'>lorem ipsum amet</span></td>" +
                        "<td class='DemoMenuBox' style='color:#666666; font-weight:bold; font-size:12px'><a href='#'>Service One</a><br /><span style='font-size:10px; font-weight:normal; color:white'>lorem ipsum amet</span></td>" +
                        "<td class='DemoMenuBox' style='color:#666666; font-weight:bold; font-size:12px'><a href='#'>Resources One</a><br /><span style='font-size:10px; font-weight:normal; color:white'>lorem ipsum amet</span></td>" +
                    "</tr>" +
                    "<tr>" +
                        "<td class='DemoMenuBox' style='color:#666666; font-weight:bold; font-size:12px'><a href='#' style='margin-left:10px'>Product Two</a><br /><span style='font-size:10px; font-weight:normal; color:white; margin-left:10px'>lorem ipsum amet</span></td>" +
                        "<td class='DemoMenuBox' style='color:#666666; font-weight:bold; font-size:12px'><a href='#'>Service Two</a><br /><span style='font-size:10px; font-weight:normal; color:white'>lorem ipsum amet</span></td>" +
                        "<td class='DemoMenuBox' style='color:#666666; font-weight:bold; font-size:12px'><a href='#'>Resources Two</a><br /><span style='font-size:10px; font-weight:normal; color:white'>lorem ipsum amet</span></td>" +
                    "</tr>" +
                    "<tr>" +
                        "<td class='DemoMenuBox' style='color:#666666; font-weight:bold; font-size:12px'><a href='#' style='margin-left:10px'>Product Three</a><br /><span style='font-size:10px; font-weight:normal; color:white; margin-left:10px'>lorem ipsum amet</span></td>" +
                        "<td class='DemoMenuBox' style='color:#666666; font-weight:bold; font-size:12px'><a href='#'>Service Three</a><br /><span style='font-size:10px; font-weight:normal; color:white'>lorem ipsum amet</span></td>" +
                        "<td class='DemoMenuBox' style='color:#666666; font-weight:bold; font-size:12px'></td>" +
                    "</tr>" +
                "</table>";
    new Guidance.MenuBox("menu1", "CORPORATE", "MenuBoxHeader", links, "MenuBoxBody", 0, 3, 3, 32);
    new Guidance.MenuBox("menu2", "LAW FIRMS", "MenuBoxHeader", links, "MenuBoxBody", 0, 3, 3, 32);
    new Guidance.MenuBox("menu3", "GOVERNMENT", "MenuBoxHeader", links, "MenuBoxBody", 0, 3, 3, 32);
    new Guidance.MenuBox("menu4", "LAW ENFORCEMENT", "MenuBoxRightHeader", links, "MenuBoxRightBody", 0, 1, 185, 32);
    new Guidance.MenuBox("menu5", "CONSULTANTS", "MenuBoxRightHeader", links, "MenuBoxRightBody", 0, 1, 185, 32);
    //    Guidance.MenuBox.menuList.push(new Guidance.MenuBox("menu1", "right", "CORPARATE", [{ text: 'link1', url: '#' }, { text: 'link1', url: '#' }, { text: 'link1', url: '#'}]));
    //    Guidance.MenuBox.menuList.push(new Guidance.MenuBox("menu2", "right", "LAW FIRMS", [{ text: 'link1', url: '#' }, { text: 'link1', url: '#' }, { text: 'link1', url: '#'}]));
    //    Guidance.MenuBox.menuList.push(new Guidance.MenuBox("menu3", "right", "GOVERNMENT", [{ text: 'link1', url: '#' }, { text: 'link1', url: '#' }, { text: 'link1', url: '#'}]));
    //    Guidance.MenuBox.menuList.push(new Guidance.MenuBox("menu4", "right", "LAW ENFORCEMENT", [{ text: 'link1', url: '#' }, { text: 'link1', url: '#' }, { text: 'link1', url: '#'}]));
    //    Guidance.MenuBox.menuList.push(new Guidance.MenuBox("menu5", "left", "CONSULTANTS", [{ text: 'link1', url: '#' }, { text: 'link1', url: '#' }, { text: 'link1', url: '#'}]));
}


Guidance.UI.initMenuBox2 = function() {
    var links = Array(12);

    for (var i = 0; i < 12; i++) {
        links[i] = "<table  width='100%' height='80%' style='text-align:left; font-family:arial;'> " +
    " <tr style ='height:20%;'> " +
    " <td style = 'width:5%'></td>" +
    " <td style= 'font-size:13px;font-color:white;vertical-align:bottom;text-align:left;width:90%'>" +
    "<span style= 'font-family: Arial;font-size:10px;color:white;'>Enter Email:</span></td> " +
    "<td  style = 'width:5%'></td>" +

    " </tr> " +

    "<tr style ='height:30%;' > " +
    "<td  style = 'width:5%'></td><td style = 'algin:left'><input type = 'text' id = 'txtEmail" + i.toString() + "' style = 'width:96%;background-color:#fbaa37;' ></td> <td  style = 'width:5%'></td>" +
    " </tr> " +

    "<tr style ='height:50%;'> " +
    "  <td  style = 'width:5%'></td><td style  = 'text-align:right;'><img src='images/Float/loginButton.png' style='cursor:pointer' /></td> <td  style = 'width:5%'></td>" +
    " </tr> " +

    " </table>";
    }

    //debugger;
    new Guidance.MenuBox("menu1", "VIEW WEBINAR", "MenuBoxHeader2", links[0], "MenuBoxBody2", 0, 3, 3, 19, "txtEmail0");
    new Guidance.MenuBox("menu2", "VIEW WEBINAR", "MenuBoxHeader2", links[1], "MenuBoxBody2", 0, 3, 3, 19, "txtEmail1");
    new Guidance.MenuBox("menu3", "VIEW WEBINAR", "MenuBoxHeader2", links[2], "MenuBoxBody2", 0, 3, 3, 19, "txtEmail2");
    new Guidance.MenuBox("menu4", "VIEW WEBINAR", "MenuBoxHeader2", links[3], "MenuBoxBody2", 0, 3, 3, 19, "txtEmail3");

    new Guidance.MenuBox("menu5", "VIEW WEBINAR", "MenuBoxHeader2", links[4], "MenuBoxBody2", 0, 3, 3, 19, "txtEmail4");
    new Guidance.MenuBox("menu6", "VIEW WEBINAR", "MenuBoxHeader2", links[5], "MenuBoxBody2", 0, 3, 3, 19, "txtEmail5");
    new Guidance.MenuBox("menu7", "VIEW WEBINAR", "MenuBoxHeader2", links[6], "MenuBoxBody2", 0, 3, 3, 19, "txtEmail6");
    new Guidance.MenuBox("menu8", "VIEW WEBINAR", "MenuBoxHeader2", links[7], "MenuBoxBody2", 0, 3, 3, 19, "txtEmail7");

    new Guidance.MenuBox("menu9", "VIEW WEBINAR", "MenuBoxHeader2", links[8], "MenuBoxBody2", 0, 3, 3, 19, "txtEmail8");
    new Guidance.MenuBox("menu10", "VIEW WEBINAR", "MenuBoxHeader2", links[9], "MenuBoxBody2", 0, 3, 3, 19, "txtEmail9");
    new Guidance.MenuBox("menu11", "VIEW WEBINAR", "MenuBoxHeader2", links[10], "MenuBoxBody2", 0, 3, 3, 19, "txtEmail10");
    new Guidance.MenuBox("menu12", "VIEW WEBINAR", "MenuBoxHeader2", links[11], "MenuBoxBody2", 0, 3, 3, 19), "txtEmail11";


}

Guidance.UI.initMenuBox3 = function() {

    var links = Array(12);

    for (var i = 0; i < 12; i++) {
        links[i] = "<table  width='100%' height='80%' style='text-align:left; font-family:arial;'> " +
    " <tr style ='height:20%;'> " +
    " <td style = 'width:5%'></td>" +
    " <td style= 'font-size:13px;font-color:white;vertical-align:bottom;text-align:left;width:90%'>" +
    "<span style= 'font-family: Arial;font-size:10px;color:white;'>Enter Email:</span></td> " +
    "<td  style = 'width:5%'></td>" +

    " </tr> " +

    "<tr style ='height:30%;' > " +
    "<td  style = 'width:5%'></td><td style = 'algin:left'><input type = 'text' id = 'txtEmail" + i.toString() + "' style = 'width:96%;background-color:#fbaa37;' ></td> <td  style = 'width:5%'></td>" +
    " </tr> " +

    "<tr style ='height:50%;'> " +
    "  <td  style = 'width:5%'></td><td style  = 'text-align:right;'><img src='images/Float/loginButton.png' style='cursor:pointer' /></td> <td  style = 'width:5%'></td>" +
    " </tr> " +

    " </table>";
    }
    //debugger;

    new Guidance.MenuBox("menu1", "DOWNLOAD PDF", "MenuBoxHeader2", links[0], "MenuBoxBody2", 0, 3, 3, 19, "txtEmail0");
    new Guidance.MenuBox("menu2", "DOWNLOAD PDF", "MenuBoxHeader2", links[1], "MenuBoxBody2", 0, 3, 3, 19, "txtEmail1");
    new Guidance.MenuBox("menu3", "DOWNLOAD PDF", "MenuBoxHeader2", links[2], "MenuBoxBody2", 0, 3, 3, 19, "txtEmail2");
    new Guidance.MenuBox("menu4", "DOWNLOAD PDF", "MenuBoxHeader2", links[3], "MenuBoxBody2", 0, 3, 3, 19, "txtEmail3");

    new Guidance.MenuBox("menu5", "DOWNLOAD PDF", "MenuBoxHeader2", links[4], "MenuBoxBody2", 0, 3, 3, 19, "txtEmail4");
    new Guidance.MenuBox("menu6", "DOWNLOAD PDF", "MenuBoxHeader2", links[5], "MenuBoxBody2", 0, 3, 3, 19, "txtEmail5");
    new Guidance.MenuBox("menu7", "DOWNLOAD PDF", "MenuBoxHeader2", links[6], "MenuBoxBody2", 0, 3, 3, 19, "txtEmail6");
    new Guidance.MenuBox("menu8", "DOWNLOAD PDF", "MenuBoxHeader2", links[7], "MenuBoxBody2", 0, 3, 3, 19, "txtEmail7");

    new Guidance.MenuBox("menu9", "DOWNLOAD PDF", "MenuBoxHeader2", links[8], "MenuBoxBody2", 0, 3, 3, 19, "txtEmail8");
    new Guidance.MenuBox("menu10", "DOWNLOAD PDF", "MenuBoxHeader2", links[9], "MenuBoxBody2", 0, 3, 3, 19, "txtEmail9");
    new Guidance.MenuBox("menu11", "DOWNLOAD PDF", "MenuBoxHeader2", links[10], "MenuBoxBody2", 0, 3, 3, 19, "txtEmail10");
    new Guidance.MenuBox("menu12", "DOWNLOAD PDF", "MenuBoxHeader2", links[11], "MenuBoxBody2", 0, 3, 3, 19, "txtEmail11");

}

Guidance.UI.showDialogWindow = function(title, width, height, targetUrl) {

    Guidance.UI.showDialogWindow2(title, width, height, targetUrl, null);
}

Guidance.UI.showDialogWindow2 = function(title, width, height, targetUrl, imageUrls) {

    Guidance.UI.showDialogWindow3(title, width, height, targetUrl, imageUrls, null);
}

//Added by Rick: Contact popup box
Guidance.UI.showDialogWindow3 = function(title, width, height, targetUrl, imageUrls, hdnButtonID) {

//    var images =
//    {
//        "button.CloseUp": "images/dian.png",
//        "button.CloseOver": "images/btn_close_up.png" 
//    };

//    pop = new Guidance.ModalWindow(title, width, height, targetUrl, images);

    pop = new Guidance.ModalWindow(title, width, height, targetUrl, imageUrls, hdnButtonID);
    setTimeout($Common.createDelegate(pop, pop.show), 500);
}
//end pop up box


Guidance.UI.closeDialogWindow = function() {
    alert("gs55");
    setTimeout($Common.createDelegate(this, this.hide), 500);

}



/**
* about_team
*/

var mh = 0;
var step = 5;
var ms = 10;


function toggle(o, box, n) {
    if (!o.tid) o.tid = "_" + Math.random() * 100;
    if (!window.toggler) window.toggler = {};
    if (!window.toggler[o.tid]) {
        window.toggler[o.tid] = {
            obj: o,
            maxHeight: 160,
            minHeight: mh,
            timer: null,
            action: -1
        };
    }
    o.style.height = o.offsetHeight + "px";
    if (window.toggler[o.tid].timer) clearTimeout(window.toggler[o.tid].timer);
    window.toggler[o.tid].action *= -1;
    window.toggler[o.tid].timer = setTimeout("anim('" + o.tid + "')", ms);
    if (box.innerHTML.indexOf("Read More") > 0)
        box.innerHTML = "<a href=\"javascript:toggle(document.getElementById('more" + n + "'),document.getElementById('box" + n + "')," + n + ")\" class='C'>Collapse [-]</a>";
    else
        box.innerHTML = "<a href=\"javascript:toggle(document.getElementById('more" + n + "'),document.getElementById('box" + n + "')," + n + ")\" class='C'>Read More [+]</a>";
}

function anim(id) {
    var t = window.toggler[id];
    var o = window.toggler[id].obj;
    if (t.action < 0) {
        if (o.offsetHeight <= t.minHeight) {
            clearTimeout(t.timer);
            return;
        }
    }
    else {
        if (o.offsetHeight >= t.maxHeight) {
            clearTimeout(t.timer);
            return;
        }
    }
    o.style.height = (parseInt(o.style.height, 10) + t.action * step) + "px";
    window.toggler[id].timer = setTimeout("anim('" + id + "')", ms);
}

//BEGIN...Training.ascx  James...
/*commented because we are using the other JS called Guicance2.js (Why??)
function DateSelected(Html_Id) {
    //infoDiv + Html_Id
    var TrainingInfo = document.getElementsByClassName('TrainingInfo');
    for (var Dt = 0; Dt < TrainingInfo.length; Dt++) {
        var SelDt = TrainingInfo[Dt];
        SelDt.className = "TrainingInfoHidden";
    }
    var infoDiv = eval("document.getElementById('infoDiv" + Html_Id + "')");
    infoDiv.className = "TrainingInfo";
    document.getElementById("registerbuttom").style.visibility = "visible";
}

function LocationSelected(Facility, Html_Id) {
    var selectedDates = document.getElementsByClassName('TrainingDateDisplay');
    for (var Dt = 0; Dt < selectedDates.length; Dt++) {
        var SelDt = selectedDates[Dt];
        SelDt.className = "TrainingDateHidden";
    }
    var selectedFacility = document.getElementsByClassName('TrainingLocationSelected');
    for (var Dt = 0; Dt < selectedFacility.length; Dt++) {
        var SelDt = selectedFacility[Dt];
        SelDt.className = "TrainingLocation";
    }
    var facility = eval("document.getElementsByName('Facility" + Facility + "')");
    for (var Dt = 0; Dt < facility.length; Dt++) {
        var SelDt = facility[Dt];
        SelDt.className = "TrainingDateDisplay";
    }
    var row = eval("document.getElementById('row" + Facility + "')");
    row.className = "TrainingLocationSelected";
    var hrf = eval("document.getElementById('hre" + Facility + "')");
    hrf.className = "TrainingLocationSelected";
    var TrainingInfo = document.getElementsByClassName('TrainingInfo');
    for (var Dt = 0; Dt < TrainingInfo.length; Dt++) {
        var SelDt = TrainingInfo[Dt];
        SelDt.className = "TrainingInfoHidden";
    }
    document.getElementById("registerbuttom").style.visibility = "hidden";
}

//IMPORT/////////////
document.getElementsByClassName = function(clsName) { var retVal = new Array(); var elements = document.getElementsByTagName("*"); for (var i = 0; i < elements.length; i++) { if (elements[i].className.indexOf(" ") >= 0) { var classes = elements[i].className.split(" "); for (var j = 0; j < classes.length; j++) { if (classes[j] == clsName) retVal.push(elements[i]); } } else if (elements[i].className == clsName) retVal.push(elements[i]); } return retVal; }

//IMPORT/////////////
*/
//END...Training.ascx James...

/**
* Training_9c.html
* begin
*/

function showDate(number) {
    for (var i = 1; i <= 13; i++) {
        var row = eval("document.getElementById('row" + i + "')");
        row.style.backgroundColor = "";
        var hrf = eval("document.getElementById('hre" + i + "')");
        hrf.style.color = "#666666";
    }
    cleanDateColumn();
    hiddenTravlInfo();
    document.getElementById("datehre1").innerHTML = "1/15/2008 - 1/18/2008"+number;
    document.getElementById("datehre2").innerHTML = "1/20/2008 - 1/23/2008"+number;
    document.getElementById("datehre3").innerHTML = "1/15/2008 - 1/19/2008"+number;
    var row = eval("document.getElementById('row" + number + "')");
    row.style.backgroundColor= "#2d699f";
    var hrf = eval("document.getElementById('hre" + number + "')");
    hrf.style.color = "#FFFFFF";
    document.getElementById("infoDiv").style.visibility = "hidden";
    document.getElementById("registerbuttom").style.visibility = "hidden";
}

function cleanDateColumn() {
    for (var i = 1; i <= 3; i++) {
        var row = eval("document.getElementById('datarow" + i + "')");
        row.style.backgroundColor = "";
        var hrf = eval("document.getElementById('datehre" + i + "')");
        hrf.style.color = "#666666";
    }
}

function showDetail(number) {
    cleanDateColumn();
    hiddenTravlInfo();
    var row = eval("document.getElementById('datarow" + number + "')");
    row.style.backgroundColor = "#2d699f";
    var hrf = eval("document.getElementById('datehre" + number + "')");
    hrf.style.color = "#FFFFFF";
    document.getElementById("infoDiv").style.visibility = "visible";
    document.getElementById("registerbuttom").style.visibility = "visible";
    document.getElementById("infoTitle").innerHTML = "<ul id='n7'>EnCase Computer Forensics " + number + "</ul>";
}


function showTravlInfo(ID,root_Id) {
    document.getElementById("travelInforContainer").style.visibility = "visible";
    
}

function hiddenTravlInfo() {
    document.getElementById("travelInforContainer").style.visibility = "hidden";
    document.getElementById("closebutton").src = "images/btn_close_up.png";
}
/**
* Training_9c.html
* end
*/

/**
* Training_9e.html
* begin
*/

var mh1 = 0;
var step1 = 5;
var ms1 = 10;


function toggleNew(o, box, n) {
    if (!o.tid) o.tid = "_" + Math.random() * 100;
    if (!window.toggler) window.toggler = {};
    if (!window.toggler[o.tid]) {
        window.toggler[o.tid] = {
            obj: o,
            maxHeight: 70,
            minHeight: mh1,
            timer: null,
            action: -1
        };
    }
    o.style.height = o.offsetHeight + "px";
    if (window.toggler[o.tid].timer) clearTimeout(window.toggler[o.tid].timer);
    window.toggler[o.tid].action *= -1;
    window.toggler[o.tid].timer = setTimeout("anim1('" + o.tid + "')", ms1);
    if (box.innerHTML.indexOf("+") > 0) {
        box.innerHTML = "<a href=\"javascript:toggleNew(document.getElementById('moredetail" + n + "'),document.getElementById('hrfe" + n + "')," + n + ")\" class='C'>[-]</a>";
    }
    else {
        box.innerHTML = "<a href=\"javascript:toggleNew(document.getElementById('moredetail" + n + "'),document.getElementById('hrfe" + n + "')," + n + ")\" class='C'>[+]</a>";
    }
}


function anim1(id) {
    var t = window.toggler[id];
    var o = window.toggler[id].obj;
    var aa = document.getElementById("wholetable");
    if (t.action < 0) {
        if (o.offsetHeight <= t.minHeight) {
            clearTimeout(t.timer);
            return;
        }
    }
    else {
        if (o.offsetHeight >= t.maxHeight) {
            clearTimeout(t.timer);
            return;
        }
    }
    o.style.height = (parseInt(o.style.height, 10) + t.action * step1) + "px";
    aa.style.height = (aa.offsetHeight + t.action * step1) + "px";
    window.toggler[id].timer = setTimeout("anim1('" + id + "')", ms1);
}



function pagenumbers(number) {
    document.getElementById("hrf1").style.display = "none";
    document.getElementById("hrf2").style.display = "none";
    document.getElementById("hrf3").style.display = "none";
    document.getElementById("hrf4").style.display = "none";
    document.getElementById("hrf5").style.display = "none";
    var hrf = eval("document.getElementById('hrf" + number + "')");
    hrf.style.display = "block";
}



/**
* Training_9e.html
* end
*/

function showpopup(pp) {
    var back = document.getElementById("blackbak");
    var clientWidth, clientHeight;
    if (navigator.userAgent.indexOf(' MSIE ') > -1) {
        clientWidth = document.documentElement.clientWidth;
        clientHeight = document.documentElement.clientHeight;
    }
    else if (navigator.userAgent.indexOf(' Safari/') > -1) {
        clientWidth = window.innerWidth;
        clientHeight = window.innerHeight;
    }
    else {
        clientWidth = Math.min(window.innerWidth, document.documentElement.clientWidth);
        clientHeight = Math.min(window.innerHeight, document.documentElement.clientHeight);
    }

    back.style.width = Math.max(Math.max(document.documentElement.scrollWidth, document.body.scrollWidth), clientWidth) + 'px';
    back.style.height = Math.max(Math.max(document.documentElement.scrollHeight, document.body.scrollHeight), clientHeight) + 'px';
    pp.style.display = 'block';
}
