﻿function $(element) 
{
    return document.getElementById(element);
}

function hightLightButton()
{
    var img = $("imgEs3Tv")
        
    if ( img != null )
    {
        img.src = img.src.replace(".jpg","_on.jpg");
    }
}

function darkButton()
{
    var img = $("imgEs3Tv")
        
    if ( img != null )
    {
        img.src = img.src.replace("_on.jpg",".jpg");
    }
}

function imgBackShow(target) {
    var img = target.children[0];

    if (img != null) {
        img.src = img.src.replace("_on.jpg", ".jpg");
    }
}

function imgBackShowOn(target) {
    var img = target.children[0];

    if (img != null) {
        img.src = img.src.replace(".jpg", "_on.jpg");
    }
}

function openWin(url, w, h) {
    var ranNum = parseInt(Math.random() * 255);
    
    var l = screen.width / 2 - w / 2;
    var t = screen.height / 2 - h / 2;

    if (typeof myWindow == "object") {
        myWindow.close();
    }
    myWindow = window.open(url, 'admintronwin' + ranNum, 'top=' + t + ',left=' + l + ',height=' + h + ',width=' + w + ',noresize,scrollbars=yes,status=yes');
}