﻿var folder = "";
function getElement(el) {
    var _el = document.getElementById("ctl00_ContentPlaceHolder1_" + el);     
    if (_el == null)
        _el = document.getElementById(el);
    return _el;
}
function getHelpElement(el) {
    var _el = document.getElementById("ctl00_hScreen_" + el);
    if (_el == null)
        _el = document.getElementById("hScreen_" + el);
    if (_el == null)
        _el = document.getElementById("ctl00_DialogHelp_ctl00_hScreen_" + el);
    return _el;
}
function getRoot() {
    return "ctl00_ContentPlaceHolder1_";
}
var showid;
function SetColor(_label, _color)
{try { getElement(_label).style.backgroundColor = (_color); } catch (e) { }  }

function SetColor(_label, _color, _textColor) {
try { 
    getHelpElement(_label).style.backgroundColor = _color;
    getHelpElement(_label).style.color = _textColor;
} catch (e) { }
}
function ShowHelp(_tblid) {
    if (getHelpElement(_tblid + "C") != null) {
        if (getHelpElement(_tblid + "C").innerHTML == "Click to hide") {
            getHelpElement(_tblid + "C").innerHTML = "Click to expand";
            getHelpElement(_tblid).style.display = "none";
        }
        else {
            getHelpElement(_tblid + "C").innerHTML = "Click to hide";
            getHelpElement(_tblid).style.display = "";
        }
    }
    else {
        getElement("LblMsg").innerHTML = "";
        showid = getElement("LblShown").innerHTML;
        if (showid > "")
            getElement(getElement("LblShown").innerHTML).style.display = "none";
        if (showid != _tblid) {
            getElement(_tblid).style.display = "";
            getElement("LblShown").innerHTML = _tblid;
        }
        else
            getElement("LblShown").innerHTML = "";
    }
}
function getBrowser() {
    var internetExplorer = false;
    if (navigator.userAgent.indexOf('MSIE 8') > 0)
        internetExplorer = false;
    else if (navigator.userAgent.indexOf('MSIE') > 0)
        internetExplorer = true;
    return internetExplorer;
}
function getFolder() {
    folder = getElement("ctl00_lblFolder").innerHTML;
}
function openPeopleWindow(strurl, w) {
    var peopleWindow;
	var winTop = (screen.height / 2) - (450 / 2);
	var winLeft = (screen.width / 2) - (w / 2);
	var windowFeatures = "toolbar=no,status=no,scrollbars=no,resizable=no,width=" + w + ",height=530,";
	windowFeatures = windowFeatures + "left=" + winLeft + ",";
	windowFeatures = windowFeatures + "top=" + winTop;
	
	peopleWindow = window.open(strurl,'mainwindow',windowFeatures)
	peopleWindow.focus();
}
function ttglow(el) {
    getElement(el).bgColor = '#b2dbf0';
    //getElement(el).style.border = '1px solid red';
}
function ttdim(el) {
    getElement(el).bgColor = '';
    //getElement(el).style.border = '';
}