﻿//-------------------------------------------------------------------------------------------------------------------->
//  This JavaScript highlights the GridView Rows and provide Redirects upon request.
//-------------------------------------------------------------------------------------------------------------------->
var orgBackColor, orgForeColor, orgCursor;

function HighLightRow(state) {
    if (/MSIE (\d+\.\d+);/.test(navigator.userAgent)) {

        var ieVersion = new Number(RegExp.$1);
        var el = window.event.srcElement.parentElement;

        if (ieVersion == 6) {

            if (state == 1) {
                orgBackColor = el.style.backgroundColor;
                orgForeColor = el.style.color;
                orgCursor = el.style.cursor;

                el.style.backgroundColor = "#ffc775";
                el.style.cursor = "pointer";
            }
            else if (state == 2) {
                orgBackColor = el.style.backgroundColor;
                orgForeColor = el.style.color;
                orgCursor = el.style.cursor;

                el.style.backgroundColor = "#ffdeae";
                el.style.cursor = "pointer";
            }
            else {
                el.style.backgroundColor = orgBackColor;
                el.style.color = orgForeColor;
                el.style.cursor = orgCursor;
            }
        }
    }
}
//-------------------------------------------------------------------------------------------------------------------->
function HightLighter(state, id) {
    var el = document.getElementById(id);

    if (state == 1) {
        orgBackColor = el.style.backgroundColor;
        orgForeColor = el.style.color;
        orgCursor = el.style.cursor;

        el.style.backgroundColor = "#ffc775";
        el.style.cursor = "pointer";
    }
    else {
        el.style.backgroundColor = orgBackColor;
        el.style.color = orgForeColor;
        el.style.cursor = orgCursor;
    }
}
//-------------------------------------------------------------------------------------------------------------------->
function SelectRow(sLink) { window.location = sLink; }
function OpenNew(sLink) { window.open(sLink, "_blank"); }
//-------------------------------------------------------------------------------------------------------------------->
//  Controls the MouseOver Effects on various parts.
//-------------------------------------------------------------------------------------------------------------------->
function IB_Over(id) { document.getElementById(id).style.display = 'block'; }
function IB_Out(id) { document.getElementById(id).style.display = 'none'; }
//-------------------------------------------------------------------------------------------------------------------->
function Show(id) { document.getElementById(id).style.display = 'block'; }
function Hide(id) { document.getElementById(id).style.display = 'none'; }
//-------------------------------------------------------------------------------------------------------------------->

function IB_Redirect(id) { window.location = "/" + id.toLowerCase() + ".aspx"; }
function IB_Redir(id) { window.location = id.toLowerCase(); }
//-------------------------------------------------------------------------------------------------------------------->
function Feat_Over(id) {
    //for (i = 1; i < 9; i++) {
    for (i = 1; i < 8; i++) {
        document.getElementById('Div' + i).style.display = 'none';
        document.getElementById('T_Div' + i).style.display = 'none';
    }

    document.getElementById(id).style.display = 'block';
    document.getElementById('T_' + id).style.display = 'block';
}
//-------------------------------------------------------------------------------------------------------------------->

