﻿function SetOnLoadSettings(oTickerValue) {
    SetTabIndex();
}

function SetTabIndex() {
    var i = 1;
    for (j = 0; j < document.forms[0].elements.length; j++) {
        if (document.forms[0].elements[j].type == 'text' || document.forms[0].elements[j].type == 'select-one' || document.forms[0].elements[j].type == 'textarea' || document.forms[0].elements[j].type == 'submit') {
            document.forms[0].elements[j].tabIndex = i++;
            if (document.forms[0].elements[j].tabIndex == 2) {
                document.forms[0].elements[j].focus();
            }
        }
    }

}

var hoverClass = "AspNet-Menu-Hover";
var topmostClass = "AspNet-Menu";
var iFramePadding = 4;

function Hover__AspNetMenu(element) {
    AddClass__CssFriendlyAdapters(element, hoverClass);

    var isIE = (navigator.userAgent.indexOf("MSIE") >= 0);
    if (isIE) {
        var child = element.firstChild;
        while (child) {
            if (child.tagName == "UL") {
                var grandchild = child.firstChild;
                while (grandchild) {
                    if (grandchild.tagName == "LI") {
                        if ((typeof (grandchild.iFrameFormElementMask) != "undefined") && (grandchild.iFrameFormElementMask != null)) {
                            grandchild.iFrameFormElementMask.style.display = "block";
                            grandchild.iFrameFormElementMask.style.width = grandchild.offsetWidth + (iFramePadding * 2);
                            grandchild.iFrameFormElementMask.style.height = grandchild.offsetHeight + (iFramePadding * 2);
                        }
                    }

                    grandchild = grandchild.nextSibling;
                }
            }

            child = child.nextSibling;
        }
    }
}

function Unhover__AspNetMenu(element) {
    RemoveClass__CssFriendlyAdapters(element, hoverClass);

    var isIE = (navigator.userAgent.indexOf("MSIE") >= 0);
    if (isIE) {
        var child = element.firstChild;
        while (child) {
            if (child.tagName == "UL") {
                var grandchild = child.firstChild;
                while (grandchild) {
                    if (grandchild.tagName == "LI") {
                        if ((typeof (grandchild.iFrameFormElementMask) != "undefined") && (grandchild.iFrameFormElementMask != null)) {
                            grandchild.iFrameFormElementMask.style.display = "none";
                        }
                    }

                    grandchild = grandchild.nextSibling;
                }
            }

            child = child.nextSibling;
        }
    }
}

function SetHover__AspNetMenu() {
    var isIE = (navigator.userAgent.indexOf("MSIE") >= 0);
    var menus = document.getElementsByTagName("ul");
    for (var i = 0; i < menus.length; i++) {
        if (menus[i].className == topmostClass) {
            var items = menus[i].getElementsByTagName("li");
            for (var k = 0; k < items.length; k++) {
                items[k].onmouseover = function() { Hover__AspNetMenu(this); }
                items[k].onmouseout = function() { Unhover__AspNetMenu(this); }

                if (isIE && ((typeof (items[k].iFrameFormElementMask) == "undefined") || (items[k].iFrameFormElementMask == null))) {
                    var iFrameFormElementMask = document.createElement("IFRAME");
                    iFrameFormElementMask.scrolling = "no";
                    iFrameFormElementMask.src = "about:blank";
                    iFrameFormElementMask.frameBorder = 0;
                    iFrameFormElementMask.style.display = "none";
                    iFrameFormElementMask.style.position = "absolute";
                    iFrameFormElementMask.style.top = -1 * iFramePadding;
                    iFrameFormElementMask.style.left = -1 * iFramePadding;
                    iFrameFormElementMask.style.filter = "progid:DXImageTransform.Microsoft.Alpha(style=0,opacity=0)";
                    iFrameFormElementMask.style.zIndex = -1;
                    items[k].insertBefore(iFrameFormElementMask, items[k].firstChild);
                    items[k].iFrameFormElementMask = iFrameFormElementMask;
                }
            }
        }
    }
}

window.onload = SetHover__AspNetMenu;

function redirectToFaceBook() {
    window.open("http://www.facebook.com/pages/Dawie-Roodt/120375891325964", "blank")
}
function redirectToYouTube() {
    window.open("http://www.youtube.com/results?search_query=dawie%20roodt&search=Search&sa=X&oi=spell&resnum=0&spell=1", "blank")
}
function redirectToTwitter() {
    window.open("http://twitter.com/Dawie_Roodt", "blank")
}
function dawieEmail() {
    window.open("mailto:dawie@efgroup.co.za", "blank")
}
function redirectToGroup() {
    window.open("http://www.efgroup.co.za/", "blank")
}
function redirectToSelect() {
    window.open("http://www.efselect.co.za/", "blank")
}
function redirectToAccess() {
    window.open("http://www.efaccess.co.za/", "blank")
}
function redirectToAdvise() {
    window.open("http://www.efadvise.co.za/", "blank")
}
function redirectToTransact() {
    window.open("http://www.eftransact.co.za/", "blank")
}
function redirectToCapital() {
    window.open("http://www.efcapital.co.za/", "blank")
}
