//Copies valuem from one element to another
function CopyValue(fromElement, toContainer, toElement)
{
    var idPath, toElemID, elem;

    //parse 'from' control id
    idPath = fromElement.id.split('_');
    
    //replace last ids with new values
    idPath[idPath.length - 2] = toContainer;
    idPath[idPath.length - 1] = toElement;
    toElemID = idPath.join('_');
    
    //try to find destination element
    elem = document.getElementById(toElemID);
    
     //if element found
    if(elem)
    {
        //if there is no old value in control
        if(!elem.value)
        {
            //set new value
            elem.value = fromElement.value;
        }
    }
}
