﻿/* ShowNHide */
function ShowDiv(divId) {
    if (document.getElementById) {
        document.getElementById(divId).style.display = 'block';
    } else {
        if (document.layers) {
            document.divId.display = 'block';
        } else {
            document.all.divId.style.display = 'block';
        }
    }
    return true;
}
function HideDiv(divId) {
    if (document.getElementById) {
        document.getElementById(divId).style.display = 'none';
    } else {
        if (document.layers) {
            document.divId.display = 'none';
        } else {
            document.all.divId.style.display = 'none';
        }
    }
    return true;
}
function CheckDiv(divId) {
    if (document.getElementById) {
        if (document.getElementById(divId).style.display == 'none') {
            return '0';
        }
        if (document.getElementById(divId).style.display == 'block') {
            return '1';
        }
    } else {
        if (document.layers) {
            if (document.divId.display == 'none') {
                return '0';
            }
            if (document.divId.display == 'block') {
                return '1';
            }
        } else {
            if (document.all.divId.style.display == 'none') {
                return '0';
            }
            if (document.all.divId.style.display == 'block') {
                return '1';
            }
        }
    }
    return true;
}
function ShownHide(divId) {
    if (CheckDiv(divId) == 0) {
        ShowDiv(divId);
    } else {
        HideDiv(divId);
    }
    return true;
}

/* SetOpacity */
function SetOpacity(ElementID, Opacity) {
    document.getElementById(ElementID).style.filter = 'alpha(opacity=' + Opacity + ')';
    document.getElementById(ElementID).style.opacity = '0.' + Opacity;
    document.getElementById(ElementID).style.MozOpacity = '0.' + Opacity;
    return true;
}

function PageLoad() {
    if (document.getElementById('Overlay')) {
        SetOpacity('Overlay', 50);
    }
    if (!document.getElementsByTagName) {
        return false;
    }
    var links = document.getElementsByTagName('a');
    for (var i = 0; i < links.length; i++) {
        if (links[i].getAttribute('rel') == 'external') {
            links[i].onclick = function() {
                return !window.open(this.href);
                this.blur();
            }
        }
        else {
            if (links[i].getAttribute('onclick') == null) {
                links[i].onclick = function() {
                    return !this.blur();
                }
            }
        }
    }
}
if (window.addEventListener) {
    window.addEventListener("load", PageLoad, false);
    window.onload = PageLoad();
}
if (window.attachEvent) {
    window.attachEvent("onload", PageLoad);
}

document.documentElement.style.overflowY = 'scroll';