﻿function ChangeToColor(pict,folder) {
    var obj;
    obj = document.getElementById(pict);
    var newName = pict.substring(0, pict.length-2) + 'color';
    obj.src = 'bannerimg.aspx?imgGUID=' + newName;
}

function ChangeToBlack(pict,folder) {
    var obj;
    var newName = pict.replace("color", "");
    
    obj = document.getElementById(newName);

    obj.src = 'bannerimggreen.aspx?imgGUID=' + newName.substring(0, newName.length - 2);
}
function ShowShedule(param) {
   
    var timeTable = document.getElementById(param);
    var SendLink = document.getElementById(param + "Link");
  
            
    if (timeTable.style.display == '') {
    
        timeTable.style.display = 'none';
       // SendLink.style.fontWeight = 'normal';
        SendLink.style.textDecoration = 'none';
       
        return;
    }

    timeTable.style.display = '';
    //SendLink.style.fontWeight = 'bold';

   // SendLink.style.textDecoration = 'underline';
}
function ShowSheduleHide(param) {
    var timeTable = document.getElementById(param);
    var SendLink = document.getElementById(param + "Link");
    var brancheshidden = document.getElementById("hide");
    if (timeTable.style.display == '') {

        timeTable.style.display = 'none';
        SendLink.style.fontWeight = 'normal';
        SendLink.style.textDecoration = 'none';
        brancheshidden.Value = null;
        return;
    }
    else {
        timeTable.style.display = '';
        SendLink.style.fontWeight = 'bold';
    }
  
    if (brancheshidden != null) {
        if (brancheshidden.Value != null) {
            var timeTablehide = document.getElementById(brancheshidden.Value);
            var SendLinknonBold = document.getElementById(brancheshidden.Value + "Link");
            timeTablehide.style.display = 'none';
            SendLinknonBold.style.fontWeight = 'normal';
            brancheshidden.Value = param;
        }
        else {
            brancheshidden.Value = param;
        }
    }
    
   


   
  
}
function ShowImgSpan(param) {

    var spanImg = document.getElementById(param);

    if (spanImg.style.display == '') {
        spanImg.style.display = 'none';
        return;
    }
    spanImg.style.display = '';
  }

function PutToHidden(param) {
    var HiddenField = document.getElementById("HiddenFieldCurrentLink");
    HiddenField.Value = param;
}

function getFieldValue(name) {
    var match = (new RegExp('[?&;]' + name + '=([^&;#]*)')).exec(location.search);
    return match ? unescape(match[1]) : "";
}

function ShowLinkDiv() {
    try {
        var s = document.getElementById("ctl00_ContentPlaceHolderLeft_LeftArrayMassive1_HiddenField2");
        var div = document.getElementById(s.value + 'div');
        var current = document.getElementById(getFieldValue('pageuid'));
        if (document.getElementById(s.value) != null) {
            document.getElementById(s.value).style.fontWeight = 'bold';
            document.getElementById(s.value).style.color = "#005d49";
        }
        if (current != null) {
            current.style.fontWeight = 'bold';
            current.style.color = "#005d49";
        }

        div.style.display = '';

      
        
    }
    catch (e) {

    }

}

function setBoldTerminals() {
    try {
        var activeLink = getFieldValue("region");
        var div1 = document.getElementById(activeLink + 'active');
        div1.style.fontWeight = 'bold';
        div1.style.textDecoration = 'underline';
    }
    catch (e)
    { }
}

function closeOnLineConsult() {
    alert("Ай, меня закрыли!");
}


