﻿
//Jscript file to cope with the fact that radio buttons don't work inside a repeater
//this function sets all the other radio buttons to clear

function CopyToHidField(hidField, copyVal) {
    var hidControl = document.getElementById(hidField);
    if (hidControl) {
        hidControl.value = copyVal;
    }   
}

function CopyCheckBoxToHidField(hidField, copyVal, chkBox) {

    var hidControl = document.getElementById(hidField);
    if (hidControl) {
        if (chkBox.checked) {
            hidControl.value = copyVal;
        }
        else {
            hidControl.value = "";
        }
    }
}

function ClearRadioButtons(controlArray, caller) {
    for (i = 0; i < controlArray.length; i++) {
        elm = document.getElementById(controlArray[i]);
        if (elm.id != caller.id)
            elm.checked = false;
    }
}

function DisplayTextInContainerDiv(ContainerId, DivId) {


    var Container = document.getElementById(ContainerId);
    var PopupDiv = document.getElementById(DivId);
    if (PopupDiv && Container ) {
        PopupDiv.style.visibility = 'visible';

        PopupDiv.style.display = "";
        var PopUpHeight = Container.scrollHeight;
        if (PopUpHeight < 150) {
            PopUpHeight = 150;
        }
        PopupDiv.style.width = Container.scrollWidth  +'px';
        PopupDiv.style.height = PopUpHeight + 'px';
    }
}

function HidePanel(parentId) {

    var ElemToHide = document.getElementById(parentId);
    if (ElemToHide) 
    {
        ElemToHide.style.visibility = 'hidden';

    }
    
}






